Date: Sat, 16 Sep 2006 06:07:05 -0400
Reply-To: Joe Whitehurst <joewhitehurst@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Whitehurst <joewhitehurst@GMAIL.COM>
Subject: Re: AF: Can I "insert" rows into data table/sas dataset model.
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
I believe this may be a limitation of the structure of SAS Datasets.
One workaround would be to load the SAS Dataset into a SCL List which
will allow you to do an actual insert wherever you would like instead
of an append.. After you have finished all the inserts, you would
need to recreate the SAS Dataset, however, so it may be just as easy
to append the observations and sort the Dataset. It really depends on
what you want to achieve. If, for some reason, you want to display
each insert as it happens, then a SCL List can handle that for you.
If you do want to use a SCL List, you will need to use the List Model
and a suitable viewer.
On 9/16/06, ra <email@example.com> 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
> 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".
> Rob ashmore
To paraphrase G. Santayana, the SAS Macro Facility used by common SAS
programmers is an old mate that gives no pleasure and many headaches,
yet she/he cannot live without it, and resents any aspersions that
strangers may cast on its character