Date: Fri, 15 Feb 2008 15:43:46 -0500
Reply-To: "data _null_," <datanull@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "data _null_," <datanull@GMAIL.COM>
Subject: Re: append varous datasets with same column names in a sas macro
In-Reply-To: <6bb5d333-49a7-41d1-ad27-6dc12be03966@e23g2000prf.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
If you many data sets that have exactly the same structure a SET with
deferred OPEN will probably be preferred, and faster than multiple
PROC APPENDs;
141
142 data class0;
143 set class1 class2 class3 OPEN=DEFER;
144 run;
NOTE: There were 19 observations read from the data set WORK.CLASS1.
NOTE: There were 19 observations read from the data set WORK.CLASS2.
NOTE: There were 19 observations read from the data set WORK.CLASS3.
NOTE: The data set WORK.CLASS0 has 57 observations and 5 variables.
NOTE: DATA statement used (Total process time)
On Fri, Feb 15, 2008 at 3:20 PM, pchoate <paulchoate61@gmail.com> wrote:
> Hi Stefan -
>
> In SAS there is proc append:
>
> proc append base=ds0 data=ds1 ds2 ds3;
> run;
>
> Which has the advantage of not reading the base dataset ds0.
>
> To do this in a macro would simple mean wrapping the above in the
> macro...
>
> %macro append;
> proc append base=ds0 data=
> %do i = 1 %to 3;
> ds&i
> %end;
> ; run;
> %mend append;
>
> %append;
>
> or something like that. You need to show some examle code for a more
> specific answer.
>
> HTH - Paul Choate
>
>
>
> On Feb 15, 10:59 am, stefan.p...@ISH.DE (Stefan Pohl) wrote:
> > Hi sas-group,
> >
> > I want to append various data set which have the same columns. Normally I
> > would use the set statement.
> > My problem is that I use a macro in which I produce n of such data sets, n
> > is the number of rows of the
> > original data set.
> >
> > How can I append this n datasets within my macro?
> >
> > Thank you for help.
> >
> > Stefan.
>
|