Multiple factors control whether macro calls are expanded in different
situations. At the highest level,
SET MEXPAND controls whether
macro calls are expanded. By default, it is enabled. See SET MEXPAND, for details.
A macro body may contain macro calls. By default, these are expanded.
If a macro body contains
!OFFEXPAND disables expansion of macro calls
until the following
A macro argument’s value may contain a macro call. These macro calls
are expanded, unless the argument was declared with the
The argument to a macro function is a special context that does not
expand macro calls. For example, if
!vars is the name of a
!LENGTH(!vars) expands to 5, as does
!LENGTH(!1) if positional argument 1 has value
To expand macros in these cases, use the
!EVAL macro function,
See Macro Functions, for details.
These rules apply to macro calls, not to uses within a macro body of
macro functions, macro arguments, and macro variables created by
!LET, which are always expanded.
SET MEXPAND may appear within the body of a macro, but it will
not affect expansion of the macro that it appears in. Use