![]() Chapter Contents |
![]() Previous |
![]() Next |
| MLOGIC |
| Type: | System option | ||||
| Can be specified in: |
| ||||
| Default: | NOMLOGIC |
| Syntax | |
| Details | |
| Example | |
| Tracing Macro Execution | |
Syntax |
| MLOGIC | NOMLOGIC |
| Details |
Use MLOGIC to debug macros. Each line generated by the MLOGIC option is identified with the prefix MLOGIC(macro-name):. If MLOGIC is in effect and the macro processor encounters a macro invocation, the macro processor displays messages that identify
Note: Using MLOGIC can produce a great deal of output. ![[cautionend]](../common/images/cautend.gif)
For more information on macro debugging, see Chapter 10, "Macro Facility Error Messages and Debugging," in SAS Macro Language: Reference.
| Example |
In this example, MLOGIC traces the execution of the macros MKTITLE and RUNPLOT:
%macro mktitle(proc,data);
title "%upcase(&proc) of %upcase(&data)";
%mend mktitle;
%macro runplot(ds);
%if %sysprod(graph)=1 %then
%do;
%mktitle (gplot,&ds)
proc gplot data=&ds;
plot style*price
/ haxis=0 to 150000 by 50000;
run;
quit;
%end;
%else
%do;
%mktitle (plot,&ds)
proc plot data=&ds;
plot style*price;
run;
quit;
%end;
%mend runplot;
options mlogic;
%runplot(sasuser.houses)
Executing this program writes this MLOGIC output to the SAS log:
MLOGIC(RUNPLOT): Beginning execution. MLOGIC(RUNPLOT): Parameter DS has value sasuser.houses MLOGIC(RUNPLOT): %IF condition %sysprod(graph)=1 is TRUE MLOGIC(MKTITLE): Beginning execution. MLOGIC(MKTITLE): Parameter PROC has value gplot MLOGIC(MKTITLE): Parameter DATA has value sasuser.houses MLOGIC(MKTITLE): Ending execution. MLOGIC(RUNPLOT): Ending execution.
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.