SAS宏系统选项SYMBOLGEN MCOMPILENOTE MPRINT<NEST> MLOGIC(NEST)

SYMBOLGEN

  Details

    1. With SYMBOLGEN enabled, SAS presenets the results of the resolution of macro variables in the SAS log, it show the value of both automaci and user-defined macro variables.

    2. Helps Debug SAS Program and it only displays macro variable values when they are referenced.

  EXAMPLE

26   options symbolgen;
27
28   %let reptitle=Book Section;
29   %let repvar=section;
30
SYMBOLGEN:  Macro variable REPTITLE resolves to Book Section
SYMBOLGEN:  Macro variable SYSDAY resolves to Tuesday
31   title “Frequencies by &reptitle as of &sysday”;
32   proc freq data=books.ytdsales;
SYMBOLGEN:  Macro variable REPVAR resolves to section
33     tables &repvar;
34   run;
NOTE: There were 3346 observations read from the data set
      BOOKS.YTDSALES.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.15 seconds
      cpu time            0.01 seconds 
SYMBOLGEN:  Macro variable REPTITLE resolves to Book Section 
SYMBOLGEN:  Macro variable SYSDAY resolves to Tuesday 
35 
36   title “Means by &reptitle as of &sysday”;
37   proc means data=books.ytdsales;
SYMBOLGEN:  Macro variable REPVAR resolves to section
38     class &repvar;
39     var saleprice;
40   run;
NOTE: There were 3346 observations read from the data set
      BOOKS.YTDSALES.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.01 seconds
      cpu time            0.03 seconds

 

mcompilenote=none/noautocall/all

  Details

    MCOMPILENOTE writes notes to the SAS log about whether a macro program compiles successfully

  Arguments

    none不会在日志中输出信息(default)

    noautocall会在日志中输出非autocall macros的所有宏的信息

    all输出所有信息

  Example

1 options mcompilenote=all;
2 %macro mymacro;
3 %mend mymacro;
NOTE: The macro MYMACRO completed compilation without errors.

 

OPTIONS MPRINT/NOMPRINT

   Details

    By default, SAS does not write to the SAS log SAS language statements submitted from within a macro program. If you want to see the SAS code that the macro processor constructs and submits, enable the MPRINT option.

    the text that is sent to the SAS compiler as a result of macro execution is printed in the SAS log

   Example

23   options mprint;
24   %prtlast
MPRINT(PRTLAST):   proc print data=WORK.SALES (obs=5);
MPRINT(PRTLAST):   run;

 

 

OPTIONS MPRINTNEST/NOMPRINTNEST

   Details

      Aligns the nesting level of macro programs and the SAS code generated by the execution of the macro programs in the SAS log.

 

OPTIONS MLOGIC | NOMLOGIC;

  Details

    The information written to the SAS log when MLOGIC is enabled includes the beginning and ending of the macro program and the results of arithmetic and logical macro language operations.

  Example

/*红色字体为作用效果*/ options nomprint mlogic;
107 %prtlast
MLOGIC(PRTLAST): Beginning execution.
NOTE: There were 1 observations read from the dataset
WORK.SALES.
NOTE: PROCEDURE PRINT used:
real time 0.02 seconds
cpu time 0.02 seconds
MLOGIC(PRTLAST): Ending execution.

  

 

OPTIONS MLOGICNEST | NOMLOGICNEST;

  Details

      Displays the nesting level of macro programs in the SAS log. This information is displayed in the MLOGIC output in the SAS log, and MLOGIC must be enabled for this option to work.

posted @ 2015-08-22 14:08  暴走的豆浆  阅读(4028)  评论(0编辑  收藏  举报