BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
hellohere
Pyrite | Level 9

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.
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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;

View solution in original post

2 REPLIES 2
Kurt_Bremser
Super User

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?

Tom
Super User Tom
Super User

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;

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 671 views
  • 0 likes
  • 3 in conversation