The %SYSMEXECNAME function
returns the name of the macro executing at the
n nesting level. The following three scenarios
are shown in the example below.
-
If
n = 0,
open code is returned.
-
If
n >%SYSMEXECDEPTH, a null string is returned and a WARNING diagnostic message is
issued to the SAS log.
-
If
n<0, a null string is returned and a WARNING diagnostic message is issued
to the SAS log.
3 %put %sysmexecdepth; /* The macro execution depth of
Open Code is zero */
0
4 %put %sysmexecname(%sysmexecdepth);
OPEN CODE
5 %put %sysmexecname(%sysmexecdepth + 1);
WARNING: Argument 1 to %SYSMEXECNAME function is out of range.
6 %put %sysmexecname(%sysmexecdepth - 1);
WARNING: Argument 1 to %SYSMEXECNAME function is out of range.