BookmarkSubscribeRSS Feed
grodman
Obsidian | Level 7

Hello - I'm attempting to call, compile, and execute a macro located in my autocall library from Enterprise Guide.  Every time I attempt to run the macro, the following error message occurs.  If I open up the macro file in my current SAS session & compile it, the program runs fine... So as far as I know the macro is written correctly.  However, when I try to call & compile the macro without manually compiling it in the current session, I get this error message. 

Anybody have any thoughts?

The options I include in the program are:

options noquotelenmax mautosource mrecall sasautos=(sasautos '\\fs01\SAS\MACROS\' '\\fs01\SAS\MACROS\Stats\');

ERROR: Expecting comma (to separate macro parameters) or close parenthesis (to end parameter list) but found: data

ERROR: A dummy macro will be compiled.

17         %role_scores (dataset=work.addginis, etc...etc..etc..,

17       ! outputdataset=work.rolesout);

17         %role_scores (dataset=work.addginis, etc... etc... etc...,

                        _

                        180

17       ! etc... etc...

17       ! outputdataset=work.rolesout);

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Autocall member, ROLE_SCORES, has not been compiled by the macro processor. It might contain a macro syntax error or not

      define a macro with the same name as the member.  To autocall this member again, set OPTION MRECALL.

5 REPLIES 5
Tom
Super User Tom
Super User

Are lines of code too long?

Make sure %MACRO statement is on the first line of the file and the %MEND is on the last line.

grodman
Obsidian | Level 7

Is there a length limit for lines of code within a macro?

%MACRO and %MEND are on both ends of the file.

Tom
Super User Tom
Super User

Personally I use 70 to 75 columns as the maximum.  I find that it is much more readable that way.  Notice how newspapers are split into columns so that each line is not too long for the field of vision of the reader.

Tom
Super User Tom
Super User

Another common error is to have two copies of the macro definition in the same file. Especially if you develop the code in interactive SAS and hit the RECALL button one too many times.

ballardw
Super User

Don't redact the macro call, show it as actually submitted as well. It appears you are likely to have some punctuation or parenthesis issue as stated. But we can't tell with a line like

%role_scores (dataset=work.addginis, etc...etc..etc..,

what may be happening.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5 replies
  • 4619 views
  • 0 likes
  • 3 in conversation