LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2008, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: cc: tammy1207@YAHOO.COM.TW

> 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


Back to: Top of message | Previous page | Main SAS-L page