Date: Fri, 19 Jul 2002 10:24:18 -0400
Reply-To: Kristi Mahadocon <kmahadocon@PDL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Kristi Mahadocon <kmahadocon@PDL.COM>
Subject: set data within a macro?
I am creating a by patient report and need to concatenate several data
sets. I have created a data set in my program that puts the data sets into
an array and gives them the generic names dat1, dat2, dat3...dat32. The
number of datasets for a given library is stored in a macro variable &num.
So, I have a dataset with one observation that looks like this:
obs dat1 dat2 ....... dat32
1 s030p200 s030p206 s030p499
How can I automate a set statement that will concatenate all 32 data sets?
This is what I tried, but only the first observation from each data set is
**this section renames the dat1...dat32 datasets to newname1...newname32
and creates them as global macro variables;
%do i = 1 %to #
**This secion is where I am trying to 'set' the data sets one after the
other, but am having trouble. &name is a global macro variable for my
data test(keep=ptid visit plate);
%do x = 1 %to #
I want my output data set to look like
Obs1 from dat1
Obs2 from dat1
Obsn from dat1
obs1 from dat2
obs2 from dat2
obsn from dat2
Any suggestions on how to accomplish this would be greatly appreciated.