Hi,
I am getting a resolution error with some SAS v9.1.3 code.
Here is some code I want to store in a .txt file (called problem2.txt) and bring into SAS with a %INC
%macro email020;
%if &email = 1 %then %do;
%put THIS RESOLVED AT 1;
%end;
%else %if &email = 2 %then %do;
%put THIS RESOVLED AT 2;
%end;
%put _user_;
%mend email020;
%email020;
Then this is the main code:
filename problem2 'C:\Documents and Settings\Mark\My Documents\problem2.txt';
%macro report1;
%let email = 1;
%inc problem2;
%mend report1;
%macro report2 (inc);
%let email = 2;
%inc problem2;
%mend report2;
data test;
run = 'YES';
run;
data _null_;
set test;
call execute("%report1");
call execute("%report2");
run;
The log shows:
NOTE: CALL EXECUTE generated line.
1 + %inc problem2;
MLOGIC(EMAIL020): Beginning execution.
WARNING: Apparent symbolic reference EMAIL not resolved.
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: &email = 1
ERROR: The macro EMAIL020 will stop executing.
MLOGIC(EMAIL020): Ending execution.
So the question is why does CALL EXECUTE generate %inc problem2 rather than %report1, causing SAS to miss the assignment and what can I do about it?