Chapter Contents

Previous

Next
CMDMAC

CMDMAC



Controls command-style macro invocation

Type: System option
Can be specified in:
Configuration file
OPTIONS window
OPTIONS statement
SAS invocation
Default: NOCMDMAC


Syntax
Details
Tip

Syntax

CMDMAC | NOCMDMAC

CMDMAC
specifies that the macro processor examine the first word of every windowing environment command to see whether it is a command-style macro invocation.

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.  [cautionend]

NOCMDMAC
specifies that no check be made for command-style macro invocations. If the macro processor encounters a command-style macro call when NOCMDMAC is in effect, it treats the call as a SAS command and produces an error message if the command is not valid or is not used correctly.


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:

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.