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 (December 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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,
Comments: To: sas-l@uga.edu
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;


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