I have a macro (shorted version below) and run well without error MSG.
The un-shorted version macro however gets a confusing ERROR MSG(below). What confusing is the code are identical.
But the MSG is not wanted since I am running with a huge loop.
Any one?!
%macro n_parse(stx, endx, byper);
/*only sect on the spots needed to speedup*/
data txx;
do i=&stx. to &endx. by &byper.;
output;
end;
run;quit;
%mend;
%n_parse(500, 1000, 5);
1 data txx; do i=&stx. to &endx. by &byper.; output; end; run;
-
22
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.
That just means the BYPER is empty. So you generated a data step like this one:
1230 data _null_; 1231 do i=1 to 5 by ; - 22 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. 1232 end; 1233 run;
It's no use showing us the code that works. To help you with failing code, we need to see that code, and the complete log from it.
From the log snippet, it looks like the macro references were not resolved. Are there any macro quoting functions involved?
That just means the BYPER is empty. So you generated a data step like this one:
1230 data _null_; 1231 do i=1 to 5 by ; - 22 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. 1232 end; 1233 run;
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.