Date: Tue, 15 Jan 2008 03:30:25 +0000
Reply-To: jay.wind@ATT.NET
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jay Jacob Wind <jay.wind@ATT.NET>
Subject: How to use macro to merge many dataset
> tammy1207@YAHOO.COM.TW asks:
> Subject: How to use macro to merge many dataset
> I have 500 dataset named from a251 to a750. All of them have exactly
> the same variables. How can I merge them into one dataset by using
> macro? Thanks.
> ------------------------------
> Date: Mon, 14 Jan 2008 13:31:30 -0600
> Subject: Re: How to use macro to merge many dataset
>
> If the data sets have exactly the same variable then merging sounds
> like the wrong thing. Perhaps vertical concatenation?
Let's assume she means unite rather than merge.
%MACRO APPEND;
%DO index=251 %TO 750;
PROC APPEND BASE=base DATA=A&index;
RUN;
%END;
%MEND;
* Just in case dataset BASE pre-exists ...;
PROC DATASETS NOFS; DELETE BASE;
RUN;
* Append all the files.;
%APPEND;
--
-- Thank you
-- Jay Jacob Wind