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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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