LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sat, 16 Sep 2006 07:09:01 -0400
Reply-To:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject:   Re: AF: Can I "insert" rows into data table/sas dataset model.

Hi Rob, 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. Regards, Gerhard

On Fri, 15 Sep 2006 23:21:08 -0700, ra <rob.ashmore@MBF.COM.AU> wrote:

>Hi all, >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 >the end? > >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 >the >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 >"single selections". > >regards, > >Rob ashmore


Back to: Top of message | Previous page | Main SAS-L page