Date: Fri, 24 Aug 2007 21:39:38 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: Questions on appending numerous datasets...
In-Reply-To: <1187988908.118177.109090@x40g2000prg.googlegroups.com>
Content-Type: text/plain; format=flowed
Here are just two of the many methods one can do this with:
/**** Method One ****/
Proc SQL NoPrint ;
Select MemName Into : MyData Separated By ' '
From Dictionary.Tables
Where LibName = 'WORK'
And MemName Like 'MYDATA%' ;
Quit ;
Data AllMyData ;
Set &MyData ;
Run ;
/**** Method Two ****/
Proc SQL ;
Create Table Master As
Select MemName
From Dictionary.Tables
Where LibName = 'WORK'
And MemName Like 'MYDATA%' ;
Quit ;
Data _Null_ ;
Set Master ;
Call Execute( 'Proc Append' ) ;
Call Execute( 'Base = AllData' ) ;
Call Execute( 'Data = ' || MemName || ' Force ; ' ) ;
Call Execute( 'Run ;' ) ;
Run ;
Toby Dunn
Two wrongs are only the beginning.
Success always occurs in private and failure in full view.
Experience is something you don't get until just after you need it.
From: wardnine@HOTMAIL.COM
Reply-To: wardnine@HOTMAIL.COM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Questions on appending numerous datasets...
Date: Fri, 24 Aug 2007 13:55:08 -0700
On Aug 22, 10:32 am, tobyd...@HOTMAIL.COM (toby dunn) wrote:
> Julie ,
>
> Use SQL and grab and load all the data set names into a MAcro variable,
then
> use that macro variable in your data step.
>
> Now if you want to use Proc Append you will need to first get all your
data
> set names in a SAS data set and then use call execute to build your Proc
> Append code.
>
> Toby Dunn
I've completed what I was doing for this project... thanks to those
who offered advice. But I'm curious about this suggestion on loading
multiple items into a macro variable? How is this accomplished? For
example, if I have 50 state abbreviations, how would I go about
loading those state abbreviations into a macro variable and how would
the SAS data step go through each "observation" in the macro variable?
I am unfamiliar with this process but I'm sure this would be useful
for future endeavors so any advice here is appreciated, thanks!
Julie
_________________________________________________________________
Now you can see trouble…before he arrives
http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_protection_0507