|
Actually, You can even make this work for you ...
data _null_;
set sashelp.vtable;
where(upcase(memname) like "TEST%");
call execute("Proc Append Base=Final Data=" || compress(memname) || "
force; run;");
run;
Cheers
Kumar
--- Lou <lpogodajr292185@COMCAST.NET> wrote:
> "Mike Rhoads" <RHOADSM1@WESTAT.COM> wrote in message
> news:403593359CA56C4CAE1F8F4F00DCFE7D072956B5@MAILBE2.westat.com...
> > Kevin,
> >
> > I think the most efficient code to run would be:
> >
> > DATA Concatenated;
> > SET First Second Third Fourth ... ... ... ...;
> > RUN;
> >
> > That means you only have one step, and each record is read and
> written
> > only once. Obviously you would want a macro to generate the list
> of
> > data sets.
>
> Nothing obvious about it at all. For instance, assuming all the
> datasets
> are in one library, and you want everything in that library:
>
> LIBNAME FEE 'physical name of the input library' ACCESS = READONLY;
> LIBNAME FIE 'physical name of the output library';
> PROC SQL NOPRINT;
> SELECT 'FEE.' || TRIM(MEMNAME) INTO :FOE SEPARATED BY ' '
> FROM DICTIONARY.TABLES
> WHERE LIBNAME = 'FEE';
> QUIT;
> DATA FUM
> SET &FOE;
> RUN;
>
> A macro variable yes, but not a macro.
>
> >
> > I'm not sure whether or not that many data sets can be handled in
> a
> > single SET statement / DATA step, however.
> >
> > If SAS gags at 1000, the next thing I'd try would be to break it
> into
> > smaller pieces -- maybe 10 data steps to combine 100 data sets at
> a
> > time, then a final one to combine the resulting 10 intermediate
> data
> > sets. Again (with a little more work) you could generate the
> necessary
> > code.
> >
> > A second possibility would be to use PROC APPEND -- again
> generating the
> > code, of course. This would be efficient in terms of
> record-handling,
> > but the overhead of 1000 steps would slow things down
> significantly.
> >
> > The slowest approach would be something like:
> >
> > DATA Final;
> > SET One;
> > RUN;
> >
> > DATA Final;
> > SET Final Two;
> > RUN;
> >
> > DATA Final;
> > SET Final Three;
> > RUN;
> >
> > etc.
> >
> > That would read and write the same records (unnecessarily) many
> times,
> > combined with the overhead of having 1000 steps.
> >
> > HTH!
> >
> > Mike Rhoads
> > Westat
> > RhoadsM1@Westat.com
> >
> >
> >
> > -----Original Message-----
> > From: owner-sas-l@listserv.uga.edu
> [mailto:owner-sas-l@listserv.uga.edu]
> > On Behalf Of Kevin F. Spratt
> > Sent: Wednesday, May 23, 2007 5:24 PM
> > To: sas-l@listserv.uga.edu
> > Subject: Concatenating a large number of data sets into one
> >
> >
> > A colleague has been provided with 1000 SAS data sets (some
> bootstrap
> > output)
> > that she wants to concatenate into one data set so that she can
> work
> > with the data using by statements.
> >
> > She has created a macro that is doing this, but it is running
> very slow.
> >
> > Surely some SAS-Ler out there has a more efficient method.
> >
> > Working in SAS 9.1.3 on Windows XP.
> >
> > Thanks in advance for any assistance.
> >
> >
> >
>
______________________________________________________________________
> >
> > Kevin F. Spratt, Ph.D.
> > Department of Orthopaedic Surgery
> > Dartmouth Medical School
> > One Medical Center Drive
> > DHMC
> > Lebanon, NH USA 03756
> > (603) 653-6012 (voice)
> > (603) 653-6013 (fax)
> > Kevin.F.Spratt@Dartmouth.Edu (e-mail)
> >
>
_______________________________________________________________________
>
Did you know? You can CHAT without downloading messenger. Click here http://in.messenger.yahoo.com/webmessengerpromo.php
|