SAS system options for debugging Macro

reference: http://studysas.blogspot.ca/2009/08/macro-debugging-optionsmprint-mlogic.html

reference: support.sas.com

mlogic, mprint, mfile, symbolgen

mlogic

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 the beginning of macro execution; values of macro parameters at invocation; execution of each macro program statement; whether each %IF condition is true or false; the ending of macro execution.

mprint

The MPRINT option displays the text generated by macro execution. Each SAS statement begins a new line. Each line of MPRINT output is identified with the prefix MPRINT(macro-name):, to identify the macro that generates the statement. Tokens that are separated by multiple spaces are printed with one intervening space.  You can direct MPRINT output to an external file by also using the MFILE option and assigning the fileref MPRINT to that file.

mfile

The MPRINT option must also be in effect to use MFILE, and an external file must be assigned the fileref MPRINT. Macro-generated code that is displayed by the MPRINT option in the SAS log during macro execution is written to the external file referenced by the fileref MPRINT.
If MPRINT is not assigned as a fileref or if the file cannot be accessed, warnings are written to the SAS log and MFILE is set to off. To use the feature again, you must specify MFILE again and assign the fileref MPRINT to a file that can be accessed.

options mfile mprint;
filename mprintdebugmac‘;

symbolgen

displays the results of resolving macro variable references.SYMBOLGEN also indicates when a double ampersand (&& ) resolves to a single ampersand (& ).