Using the MPRINTNEST Option
The MPRINT option is an essential tool when developing macros allowing you to see the SAS code generated by a macro within the log. If however one macro makes a call to another which then generates SAS code, this cannot easily be seen and recognized in the log. This problem is illustrated in the following example:
The code above will generate the following log entries, note how although the name of the inner macro is printed, there is no indication of the fact that it is nested:
Log without MPRINTNEST:
Submitting the same macro a second time but with the MPRINTNEST option included as well as the MPRINT option provides details of the macro nesting in the log.
Log with MPRINTNEST:
It is now clear to see that the second macro call is nested within the first, and if further nested call are made this will also be displayed in the same format (macro name separated by dots). For further information view the SAS help entries or the SAS support website (www.support.sas.com).