Date: Thu, 11 Feb 2010 14:25:30 -0800
Reply-To: Tom Abernathy <tom.abernathy@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Tom Abernathy <tom.abernathy@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: how to append all sas dataset
Content-Type: text/plain; charset=ISO-8859-1
On Feb 11, 10:29 am, skyuu <fan...@gmail.com> wrote:
> I have a lot of monthly sas dataset with the same variables in a
> folder. Is it possible to append all the data together in an easy way?
>
> Thanks,
> Jess
Yes.
Data new; set one two three ....... ; run;
There are many ways to get the list of dataset names.
Easiest is to point a LIBNAME at it (I assume you are doing that
already anyway) and then query the metadata to find the names.
If you use SQL it is easy to put the names into a macro variable.
proc sql noprint;
select catx('.',libname,memname) into :dslist separated by ' '
from dictionary.members
where libname='MYLIB'
;
quit;
data new; set &dslist; run;
If there is no way to tell which dataset the records came from then
look at the INDSNAME option of the SET statement.
- Tom