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 (January 2010, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 5 Jan 2010 09:56:27 -0800
Reply-To:     Tom Abernathy <tom.abernathy@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Tom Abernathy <tom.abernathy@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: Regarding SAS Macro
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

In this particular case you do not need macro logic at all as SAS allows an empty condition on the WHERE statement. Try this code:

proc means data=sashelp.class; where; run;

On Jan 5, 11:37 am, mlhow...@avalon.net (Mary) wrote: > Thanks. Actually I could use this, as I'm sometime writing code > passing in the condition statement for the procedure: > > If I wanted to check whether the condition macro variable was blank or not, > could I do this sort of thing? > > %if &condition= %then %do; > proc tabulate; > code.... > run; > %else %do; > proc tabulate; > code... > where &condition; > run; > %end; > > And what about quoting? It would be nice in the code below to somehow get the > condition statement into the macro variable so that I wouldn't have to have > more than one proc in something like the above; but I'm not quite sure how to > accomplish that. Could I do this? > > proc tabulate; > code.... > %if &condition= %then %do; > %else %do; > where &condition; > %end; > run; > > -Mary >


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