> From: plw213
> I am trying to use the IN operator in macro code, but cannot get it to
> work. the code look like this:
> %if &RptMBS2 # Middle Key %then %do ;
> The Log issues the following error:
> ERROR: A character operand was found in the %EVAL function or %IF
> condition where a numeric operand is required. The condition was:
> &RptMBS2 # Middle Key
> All I am trying to do is check for the condition that the Character
> value of &RptMBS2 is either 'Middle' or 'Key'.
> Anyone know why this doesn't work?
too much code was broken for users who had pound sign in their testing
so the macro operator in :: # was disabled.
look for this in v9.2, maybe
in the meantime, this trick may work:
or %index(&RptMBS2.,Key) %then %do;
defensive programmers might want to %upcase both arguments
or %index(%upcase(&RptMBS2.),KEY) %then %do;
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov