Desktop productivity for business analysts and programmers

.sas program having Macros not recognizing in EG and not running

Reply
Contributor SYN
Contributor
Posts: 39

.sas program having Macros not recognizing in EG and not running

I am running one program having 3 inbuilt macros.

I am trying to execute in EG it is running continuously. But no error.

Please help in this regard. Thank you.

PROC Star
Posts: 7,439

Re: .sas program having Macros not recognizing in EG and not running

It would help if you post your macros

SAS Super FREQ
Posts: 8,820

Re: .sas program having Macros not recognizing in EG and not running

Hi:

  This is a nearly impossible question to answer. Someone needs to look at the code and the log to see whether there is anything obvious that is causing the issue. It could be as simple as a missing %MEND or a failure to invoke a macro program definition after you compile it. On the other hand, it could be some other issue or generated code that fails. How do you know that the .SAS program is running continuously? When a macro program is compiled, you do NOT see any compile messages in the SAS log, unless you turn on the MCOMPILENOTE option. And, even then, if you successfully compile a SAS Macro program definition, you still need to invoke that definition. So, for example:

options mcompilenote=all;

%macro hw;

%put Hello World!;

%mend hw;

 

when you submit the above program, the only result in the LOG will be:

NOTE: The macro HW completed compilation without errors.

      5 instructions 64 bytes.

If you have MCOMPILENOTE turned on, then you will see the note; otherwise, you won't see anything in the SAS Log. But even if the macro compiles successfully, you still won't get any results from the generated code until you INVOKE the macro program:

%hw

in which case, after you submit, you should see the following in your LOG:

5

6

7    %hw      <--- %hw is the way to invoke the macro program previously defined

Hello World!  <--- this line in the log was written by the %PUT statement

Depending on whether your macro program definition has keyword parameters or positional parameters, you might have an issue with incorrectly specified parameters. You could have quoting issues.

The best resource for help with SAS programs and macro definitions, is SAS Tech Support. They can look at ALL your code, collect your operating system and EG information and provide you with hints for debugging your problem.

  To open a track with Tech Support, send mail to support@sas.com or, fill out the form at this link:http://support.sas.com/ctx/supportform/createForm or you can call them at 919-677-8008 to open a track.

cynthia

Occasional Contributor
Posts: 16

Re: .sas program having Macros not recognizing in EG and not running

Thanks.

mcompilenote  is a very useful opiton.

Ask a Question
Discussion stats
  • 3 replies
  • 250 views
  • 1 like
  • 4 in conversation