Hi all,
I made some codes including macro. They went well when I used last week, but I always found errors when using them this week
%macro try(missper,n_boot);
%MACRO mi(missper);
data rmse&missper;
set rmse&missper;
index = &i;
run;
%if &i=1 %then %do;
data poolrmseem&missper rmse_old rmse&missper;
set rmse&missper;
index = &i;
run;
%end;
%else %if &i>1 %then %do;
data poolrmseem&missper;set rmse_old rmse&missper;run;
data rmse_old;set poolrmseem&missper;run;
%end;
%mend mi;
%mi(&missper);
%let i=1;
%do %until (&i>&n_boot);
%mi(&missper);
%let i = %eval(&i+1);
%end;
%mend try;
%try (20, 5);
. Pretty weird!
I have listed the code and log message below. Could anybody help me to find out the reason? Thanks.
22: LINE and COLUMN cannot be determined.
NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN
where the error has occurred.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant,
a datetime constant, a missing value, INPUT, PUT.
WARNING: Apparent symbolic reference I not resolved.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.RMSE20 may be incomplete. When this step was stopped there were 0
observations and 5 variables.
WARNING: Data set WORK.RMSE20 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
WARNING: Apparent symbolic reference I not resolved.
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is
required. The condition was: &i=1
ERROR: The macro MI will stop executing.
Not weird!
Why do you have
%mi(&missper);
in your code before you begin the loop. SAS doesn't hasn't, at that point, created macro variable &i
If you remove that line the code does whatever it is doing.
Art, CEO, AnalystFinder.com
Not weird!
Why do you have
%mi(&missper);
in your code before you begin the loop. SAS doesn't hasn't, at that point, created macro variable &i
If you remove that line the code does whatever it is doing.
Art, CEO, AnalystFinder.com
Thanks, I remove it and the error gone.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.