Date: Wed, 3 Dec 2008 07:05:49 -0800
Reply-To: GuyA <guya.carpenter@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: GuyA <guya.carpenter@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: avoid making macro just to use %if,
Content-Type: text/plain; charset=ISO-8859-1
I was thinking about this recently, with the difficulty I was having
in making a conditional SET statement. The best thing I could come up
with without a superfluous "macro wrapper" was the following:
/* Conditionally set dataset: */
data second;
var='second';
run;
data _null_;
if %qsysfunc(exist(first)) then call symputx('set','first');
else call symputx('set','second');
run;
%put set=&set;
data output;
set &set;
run;
|