you are there at a limitation of relational models (not only SAS). To do
what you need, a hierarchical model would be better. In that case the
records are linked with pointers and the problem is only to relink that
pointers (onother thing is the physical representation of that model, which
is not as easy as it sounds). You could simulate that with SCL lists, where
it is also easy to change the pointer adresses. SAS does that for you and
you can insert something wherever you want. The disatvantage however is, you
have to hold the whole dataset in memory. You might need much memory for
that and increasing time to build the list and write it back to disk.
Another thing might be some kind of checkpointing to track in which state
your disk-DB is. Necessary for crashes, because you might do things with
your memory structure without write it back to disk.
You might decide if that's worth the effort. If you have small datasets,
where the memory might be a circumvention, also a rebuilding of the dataset
is very fast. If you have big datasets, that memory is too small and it
lasts to long to build the list and save it intermediately to keep your
changes. In that case you should think about building a seperate table with
your changes as long as you change and rebuild the big table by merging the
small one by a primary key if you're ready with changing.
On Fri, 15 Sep 2006 23:21:08 -0700, ra <rob.ashmore@MBF.COM.AU> wrote:
>When using the SAS dataset Model _copyRow () and _commitNewRow()
>method to copy a row in a table it copies the selected row and appends
>to the end of the table.
>Is there a way (simple or otherwise) I can copy it to the 'next' row in
>the table rather than
>Eg, in a 10 row table, I wish to repeat the third row and have the new
>row appear as the fourth in the table. By default, if I copy/commit
>row it appears as the eleventh.
>I guess I am really looking for some kind of 'insert new row as copy of
>selected row' methodology.
>It would be useful to be able to do this on "multiple selections" but I
>would be happy enough to do it on "extended selections" or at a push