Lesson 11, Part 5: Macro Debugging Options¶
SYMBOLGEN, MPRINT, MLOGIC, MFILE
SYMBOLGEN: When this option is specified in the OPTIONS statement, the macro variable values are written to the SAS Log.
MLOGIC: When this option is specified in the OPTIONS statement, the following information is displayed in the SAS Log. See the SAS Log below.
- Begining execution
- Results of various operations
- Ending execution
MPRINT: After macro execution, the SAS code is generated and sent to the SAS compiler. By default, SAS does not write to the SAS Log SAS statemets constrcted by the macro processor. When the MPRINT option is specified, the generated code is dispalyed in the SAS Log. See the SAS Log below.
MPRINT and MFILE: When the MFILE option, in addition to the MPRINT option, is specified in the OPTIONS statement, the addition of the MPRINT as fileref to the the FILENAME statment enables the SAS code generated in the file specified in the FILENAME statement. (Week 9 Handouts, see pages 33-34 for code and output)
options nodate nonumber nosource;
ods html close;
%macro run_freq(row_var);
proc freq data=sashelp.heart noprint;
tables %if &row_var ne %then &row_var *;
smoking_status;
run;
%mend run_freq;
options SYMBOLGEN MPRINT MLOGIC;
%run_freq()
%run_freq(Weight_Status)
The SAS System
NOTE: Writing HTML5(SASPY_INTERNAL) Body file: _TOMODS1
MLOGIC(RUN_FREQ): Beginning execution.
MLOGIC(RUN_FREQ): Parameter ROW_VAR has value
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 55:18.57
cpu time 0.09 seconds
MPRINT(RUN_FREQ): proc freq data=sashelp.heart noprint;
SYMBOLGEN: Macro variable ROW_VAR resolves to
MLOGIC(RUN_FREQ): %IF condition &row_var ne is FALSE
MPRINT(RUN_FREQ): tables smoking_status;
MPRINT(RUN_FREQ): run;
NOTE: Processing will terminate because there are no valid requests for displayed output or output data sets.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
MLOGIC(RUN_FREQ): Ending execution.
MLOGIC(RUN_FREQ): Beginning execution.
MLOGIC(RUN_FREQ): Parameter ROW_VAR has value Weight_Status
MPRINT(RUN_FREQ): proc freq data=sashelp.heart noprint;
SYMBOLGEN: Macro variable ROW_VAR resolves to Weight_Status
MLOGIC(RUN_FREQ): %IF condition &row_var ne is TRUE
SYMBOLGEN: Macro variable ROW_VAR resolves to Weight_Status
MPRINT(RUN_FREQ): tables Weight_Status * smoking_status;
MPRINT(RUN_FREQ): run;
NOTE: Processing will terminate because there are no valid requests for displayed output or output data sets.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
MLOGIC(RUN_FREQ): Ending execution.
E3969440A681A2408885998500000018