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;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.