macro functions
Macro functions are functions defined by the macro facility. They process one or
more arguments and produce a result. For example, the %SUBSTR function creates a
substring of another string, when the %UPCASE function converts characters to
uppercase. A special category of macro functions, the macro quoting functions, mask
special characters so that they are not misinterpreted by the macro processor.
There are two special macro functions, %SYSFUNC and %QSYSFUNC, that
provide access to SAS language functions or user-written functions generated with
SAS/TOOLKIT. You can use %SYSFUNC and %QSYSFUNC with new functions
in Base SAS software to obtain the values of SAS host, base, or graphics options.
These functions also enable you to open and close SAS data sets, test data set
attributes, or read and write to external files. Another special function is
%SYSEVALF, which enables your macros to perform floating-point arithmetic.
For a list of macro functions, see “Macro Functions” on page 160. For a discussion
of the macro quoting functions, see Macro Quoting on page 82. For the syntax of
calling selected Base SAS functions with %SYSFUNC, see Syntax for Selected
Functions with the %SYSFUNC Function on page 439.
autocall macros
Autocall macros are macros defined by SAS that perform common tasks such as the
following:
• trimming leading
• trailing blanks from a macro variable's value
• returning the data type of a value
For a list of autocall macros, see “Selected Autocall Macros Provided with SAS
Software” on page 171.
automatic macro variables
Automatic macro variables are macro variables created by the macro processor. For
example, SYSDATE contains the date SAS is invoked. See Chapter 12, “Macro
Language Elements,” on page 157 for a list of automatic macro variables.
macro facility interfaces
Interfaces with the macro facility provide a dynamic connection between the macro
facility and other parts of SAS, such as the following:
• DATA step
• SCL code
• SQL procedure
• SAS/CONNECT software
For example, you can create macro variables based on values within the DATA step
using CALL SYMPUT and retrieve the value of a macro variable stored on a remote
host using the %SYSRPUT macro statement. For more information about these
interfaces, see Interfaces with the Macro Facility on page 103.
14 Chapter 1 • Introduction to the Macro Facility