BookmarkSubscribeRSS Feed
GN0001
Barite | Level 11

Hello team,

I run a program and I get this error. The datasets are out and they are correct.

mbcde is a libray name:

NOTE: Line generated by the macro variable "ABC_FILE".
767         mbcde.
            ______
            22
            201




ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, ;, CUROBS, END, INDSNAME, KEY, KEYRESET, KEYS, 
              NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.  

ERROR 201-322: The option is not recognized and will be ignored.

I appreciate any resposne.

blue blue

Blue Blue
3 REPLIES 3
Tom
Super User Tom
Super User

You haven't really shown enough of the log to tell what you run.  

For example it seems to say you expanded the macro variable ABC_FILE, but you don't show the SAS code you submitted that would have expanded that macro variable.

 

One thing to check for is macro quoting. That can sometimes confuse the hand off of code generated by the macro processor to the SAS complier to interpret. 

 

For example if you have a macro variable named LIBREF and another named DATASET and want to use them to generate a two level name, like:

&libref..&dataset

You might need to add %UNQUOTE() around the whole thing so the macro process sends the result to SAS as one token so it knows should treat it as a single two level name and not two separate strings.

proc print data=%unquote(&libref..&dataset) ;
run;
ballardw
Super User

If you macro variable is used on a SET statement then that is likely to be a LIBRARY, or treated as such but is missing the actual data set name.

So how you make &ABC_FILE needs to be examined.

 

If you want help, then provide the entire code and best with some example data.

PaigeMiller
Diamond | Level 26

@GN0001 we need the ENTIRE log for this DATA step, not parts of it. From now on, in every situation where you have an error in the log, show us the ENTIRE log for the step with the error.

--
Paige Miller

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
  • 3 replies
  • 432 views
  • 2 likes
  • 4 in conversation