Using Autocall Macros
To use an autocall macro, call it in your program with the statement %macro-name. The
macro processor searches first in the Work library for a compiled macro definition with
that name. If the macro processor does not find a compiled macro and if the
MAUTOSOURCE is in effect, the macro processor searches the libraries specified by
the SASAUTOS option for a member with that name. When the macro processor finds
the member, it does the following:
1. compiles all of the source statements in that member, including all macro definitions
2. executes any open code (macro statements or SAS source statements not within any
macro definition) in that member
3. executes the macro with the name that you invoked
After the macro is compiled, it is stored in the Work.SASMacr catalog and is available
for use in the SAS session without having to be recompiled.
You can also create your own autocall macros and store them in libraries for easy
execution. For more information, see Chapter 9, “Storing and Reusing Macros,” on page
115.
Autocall Macros for Double-Byte Character Set (DBCS)
Because East Asian languages have thousands of characters, double (two) bytes of
information are needed to represent each character. Each East Asian language usually
has more than one DBCS encoding system. SAS processes the DBCS encoding
information that is unique for the major East Asian languages. The following table
contains definitions for the autocall macros that support DBCS.
Table 12.14 Autocall Macros for DBCS
Autocall Macros Description
%KLOWCASE and %QKLOWCAS Changes the uppercase characters to lowercase.
%KTRIM and %QKTRIM Trims the trailing blanks.
%KVERIFY Returns the position of the first character unique to an expression.
For more information, see “Dictionary of Autocall Macros for NLS” in SAS National
Language Support (NLS): Reference Guide.
Selected System Options Used in the Macro
Facility
The following table lists the SAS system options that apply to the macro facility.
Selected System Options Used in the Macro Facility 173