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 (April 2007, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 5 Apr 2007 11:44:16 -0700
Reply-To:   monal kohli <k_monal_99@YAHOO.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   monal kohli <k_monal_99@YAHOO.COM>
Subject:   Re: Appending to a master dataset
Comments:   To: Alon <akadas@GMAIL.COM>
Content-Type:   text/plain; charset=ascii

%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


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