|
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;
>
|