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 (July 2011, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 1 Jul 2011 13:43:55 -0500
Reply-To:   "Data _null_;" <iebupdte@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Data _null_;" <iebupdte@GMAIL.COM>
Subject:   Re: SAS %Window macro question
Comments:   To: David Kellerman <dak9057@nyp.org>
In-Reply-To:   <201107011835.p61GUVwK003515@waikiki.cc.uga.edu>
Content-Type:   text/plain; charset=ISO-8859-1

I think you will need this option.

MINOPERATOR System Option Controls whether the macro processor recognizes and evaluates the IN (#) logical operator.

and you will also want to check out.

MINDELIMITER= System Option Specifies the character to be used as the delimiter for the macro IN operator.

On Fri, Jul 1, 2011 at 1:35 PM, David Kellerman <dak9057@nyp.org> wrote: > I am new to the windowing environment in SAS. I have created a window to > get some parameters to run the program but have one breaking point. In the > following code I cannot seem to get the > > %if &sch %NOT in(002,136,164) %then %do; > statement to evaluate properly. > The error is: > ERROR: A character operand was found in the %EVAL function or %IF condition > where a numeric operand is required. The condition was: &sch %NOT > in(002,136,164) > I tried enclosing values in " ", no luck. I'm sure it's simple, but I can't > see it. > > %MACRO DatesGet; > %LET null=; > %LET errormsg=; > %redodates:; > %display GetDates.getinfo; > %if &m EQ &null or &y = &null or &sch = &null > %then %goto redodates; > %if &sch %NOT in(002,136,164) %then %do; > %LET ERR_MSG="Shools must be 3 characters - 002,136,200"; > %DISPLAY GetDates.errormsg BELL; > sch=; > %goto redodates; > %end; > > Data _NULL_; file print notitle; > ATTRIB sch_w length=$3; > bdate=mdy(&m,1,&y); > edate=mdy(&m+1,1,&y)-1; > currMonth=put(&y,4.)||put(&m,Z2.); > sch_w=put(&SCH,z3.); > Call SYMPUT("BEGDT",bdate); > Call SYMPUT("ENDDT",edate); > Call SYMPUT("currmonth",currMonth); > Call SYMPUT("SCH",sch_w); > run; > %PUT _ALL_; > > %mend Datesget; > %Datesget; >


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