Macro compilation error

Reply
Occasional Contributor
Posts: 19

Macro compilation error

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.

Super User
Super User
Posts: 7,083

Re: Macro compilation error

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.

Occasional Contributor
Posts: 19

Re: Macro compilation error

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

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

Super User
Super User
Posts: 7,083

Re: Macro compilation error

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.

Super User
Super User
Posts: 7,083

Re: Macro compilation error

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.

Super User
Posts: 11,343

Re: Macro compilation error

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.

Ask a Question
Discussion stats
  • 5 replies
  • 345 views
  • 0 likes
  • 3 in conversation