11-17-2017 05:29 AM
I am getting below error when executing below stmnt in a macro . Val is numeric and runstatus is character .
%if (val=0) AND (Runstatus = 'F' or RUNSTATUS='' ) %then
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was:
val=1 and runstatus = "F" or ""
11-17-2017 05:43 AM
The text(!) val is never numeric; either you missed using the ampersand for macro variable &val, or you tried to access a data step variable, which is impossible from the macro preprocessor.
To clarify, post your complete code.
11-17-2017 05:46 AM
%if construct is a macro function. You cannot use datastep variables in the construct - macro is resolved before datastep compilation.
Post your code on what you are trying to do - we can't tell from tiny snippets. First question would be why you are using a macro if construct to try to check datastep variables which will not work.
11-17-2017 05:47 AM
11-17-2017 05:48 AM
11-17-2017 05:56 AM
11-17-2017 06:03 AM
There can only be one datastep active at any given time. Please describe what you want to accomplish, post example data (in a data step to easily recreate your data), and what your expected result should look like.
11-17-2017 06:04 AM
Post examples, show test data in the form of a datastep, and what you want to achieve. Its hard to keep guessing what you mean. You can create code from one datastep in numerous ways:
data _null_; set have; if val=1 then call execute('data want; file "abc.txt";...;run;'); run;
11-17-2017 06:06 AM