| Date: | Tue, 15 Nov 2005 10:05:43 -0800 |
| Reply-To: | chris@OVIEW.CO.UK |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | chris@OVIEW.CO.UK |
| Organization: | http://groups.google.com |
| Subject: | Re: Macro Issue |
|
| In-Reply-To: | <1132071134.106137.101790@g14g2000cwa.googlegroups.com> |
| Content-Type: | text/plain; charset="iso-8859-1" |
|---|
Hi Richie,
It depends what you mean by 'run the code'. My suggestion was that you
would modify your macro to simply add the content of dataset E into
dataset F each time the macro runs. Therefore, you wouldn't want F to
be empty each time you ran the macro, but you would want it to be emtpy
before the first run of the macro - this is simply to prevent a
'dataset does not exist' error on the first run of the macro.
So, the macro would have:
* or PROC APPEND - this way is slower but keeps F sorted by state;
data F;
set F E;
by state;
run;
and the main program would have:
* Create empty F;
data F;
length state $ 2;
stop;
run;
* Get the data;
%state(states = NY);
%state(states = CA);
:
:
* Do something with F;
proc print data = f;
run;
.........etc.
Chris.
--------------------------------------------------------
Elvis SAS Log Analyser - http://www.oview.co.uk/elvis
--------------------------------------------------------
|