|
%macro appd(a,b);
%if %SYSFUNC(EXIST(&a))=1 %then %do;
proc append base=&a data=&b force;
run;
%end;
%mend;
%appd(ran1,ran2);
HTH
Mona
----- Original Message ----
From: Alon <akadas@GMAIL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Sent: Thursday, April 5, 2007 2:23:00 PM
Subject: Appending to a master dataset
I have been using the following macro to append before:
%macro appnd(a,b);
data &a;
set &a &b;
run;
%mend;
The reason why I critic this method is that it reads in both datasets
rather than just reading dataset &b and adding observations to the end
of dataset &a, and being that &a is the master dataset it can get very
large and I would like to avoid this. If I am wrong here and SAS is
smarter than I think then please correct my assumptions.
In addition I want to give this macro some error handling. Meaning,
say &a never existed, if that is the case then:
data &a;
run;
How can I go about this.
Thanks,
Alon
____________________________________________________________________________________
Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html
|