Chapter Contents |
Previous |
Next |
CMDMAC |
Type: | System option | ||||
Can be specified in: |
| ||||
Default: | NOCMDMAC |
Syntax | |
Details | |
Tip |
Syntax |
CMDMAC | NOCMDMAC |
Note: When CMDMAC is in effect, SAS searches the macro
libraries first and executes any member it finds with the same name as the
first word in the windowing environment command that was issued. This can
produce unexpected results.
Details |
The CMDMAC system option controls whether macros defined as command-style macros can be invoked with command-style macro calls or if these macros must be invoked with name-style macro calls. These two examples illustrate command-style and name-style macro calls, respectively:
macro-name parmameter-value-1 parmameter-value-2
%macro-name(parameter-value-1, parameter-value-2)
When you use CMDMAC, processing time is increased because the macro facility searches the macros compiled during the current session for a name corresponding to the first word on the command line. If the MSTORED option is in effect, the libraries containing compiled stored macros are searched for a name corresponding to that word. If the MAUTOSOURCE option is in effect, the autocall libraries are searched for a name corresponding to that word. If the MRECALL system option is also in effect, processing time can be increased further because the search continues even if a word was not found in a previous search.
Regardless of which option is in effect, you can use a name-style invocation to call any macro, including those defined as command-style macros.
Tip |
Name-style macros are the more efficient choice for invoking macros because the macro processor searches only for a macro name corresponding to a word following a percent sign.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.