|
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On
> Behalf Of S øren Lassen
> Sent: Wednesday, April 29, 2009 2:01 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: How to create a dataset by appending a single
> (i.e same) dataset multiple times.??
>
> Gerhard,
> I do not suggest using "set statement with 100 input
> datasets". I suggest
> iterating over the same set statement a number of times.
>
> Why so complicated? Because the original poster wanted that order
> of the obs.
>
> I think that Dan is right - as the size of the input data set grows,
> the advantage of using a single data step decreases, and may
> eventually disappear. On the other hand, I still prefer this log
> entry (the times were for the original 3 obs. sample data set):
>
> NOTE: The data set WORK.WANT has 300 observations and 2 variables.
> NOTE: DATA statement used:
> real time 0.00 seconds
> cpu time 0.00 seconds
>
> to parsing a log with 100 notes about PROC APPEND.
>
> But of course, if the order of the observations is not
> important, your suggestion is probably to be preferred.
>
> Regards,
> Søren
>
> On Wed, 29 Apr 2009 04:44:37 -0400, Gerhard Hellriegel
> <gerhard.hellriegel@T-ONLINE.DE> wrote:
>
> >I'd not use a set statement with 100 input datasets! Note
> that SAS creates
> >a buffer for each dataset which costs a lot of memory and a
> lot of CPU
> >time.
> >If you want to do that, use at least open=defer as option for each
> dataset.
> >
> >One question: why so complicated? The following does the
> same, only with
> >another order for the obs:
> >
> >data a;
> > set sashelp.class;
> > do i= 1 to 100;
> > output;
> > end;
> > drop i;
> >run;
> >
> >Gerhard
> >
> >
> >
Well, as usual, then L has given the OP several options to choose from. I
also appreciate the various posts because I always learn something, or at
least am reminded of things to think about that I sometimes fail to do. I
hadn't thought about the implications of having a very wide dataset on
overhead for proc append. Thanks Gerhard. And I agree with Søren that a
single data step produces a much cleaner log. And data _null_ presented a
novel use of Proc surveyselect. Always interesting on the L.
Dan
Daniel Nordlund
Bothell, WA USA
|