The SAS Component Language (SCL) provides two elements for using the SAS macro
facility to define macros and macro variables for SCL programs.
Table 12.11 Interfaces to the SAS Component Language
Element Description
SYMGETN Returns the value of a global macro variable as a numeric value.
SYMPUTN Assigns a numeric value to a global macro variable.
The SQL procedure provides a feature for creating and updating macro variables with
values produced by the SQL procedure.
Table 12.12 Interfaces to the SQL Procedure
Element Description
INTO Assigns the result of a calculation or the value of a data column.
For more information, see “Interfaces with the Macro Facility” on page 103.
Selected Autocall Macros Provided with SAS
Software
Overview of Provided Autocall Macros
SAS supplies libraries of autocall macros to each SAS site. The libraries that you receive
depend on the SAS products licensed at your site. You can use autocall macros without
having to define or include them in your programs.
When SAS is installed, the autocall libraries are included in the value of the
SASAUTOS system option in the system configuration file. The autocall macros are
stored as individual members, each containing a macro definition. Each member has the
same name as the macro definition that it contains.
Although the macros available in the autocall libraries supplied by SAS are working
utility programs, you can also use them as models for your own routines. In addition,
you can call them in macros that you write yourself.
To explore these macro definitions, browse the commented section at the beginning of
each member. See the setting of SAS system option SASAUTOS, to find the location of
the autocall libraries. To view the SASAUTOS value, use one of the following:
the OPTIONS command in the SAS windowing environment to open the OPTIONS
window
the OPTIONS procedure
the VERBOSE system option
the OPLIST system option
Selected Autocall Macros Provided with SAS Software 171
For more information about these options, see “SAS System Options,” in SAS System
Options: Reference.
The following table lists selected autocall macros.
Table 12.13 Selected Autocall Macros
Macro Description
CMPRES and QCMPRES Compresses multiple blanks and removes leading and trailing
blanks. QCMPRES masks the result so that special characters and
mnemonic operators are treated as text instead of being
interpreted by the macro facility.
COMPSTOR Compiles macros and stores them in a catalog in a permanent
SAS library.
DATATYP Returns the data type of a value.
LEFT and QLEFT Left-aligns an argument by removing leading blanks. QLEFT
masks the result so that special characters and mnemonic
operators are treated as text instead of being interpreted by the
macro facility.
SYSRC Returns a value corresponding to an error condition.
TRIM and QTRIM Trims trailing blanks. QTRIM masks the result so that special
characters and mnemonic operators are treated as text instead of
being interpreted by the macro facility.
VERIFY Returns the position of the first character unique to an expression.
Required System Options for Autocall Macros
To use autocall macros, you must set two SAS system options:
MAUTOSOURCE
activates the autocall facility. NOMAUTOSOURCE disables the autocall facility.
SASAUTOS=library-specification | (library-specification-1..., library-specification-n)
specifies the autocall library or libraries. For more information, see the SAS
companion for your operating system.
If your site has installed the autocall libraries supplied by SAS and uses the standard
configuration of SAS software supplied by SAS, you need only to ensure that the SAS
system option MAUTOSOURCE is in effect to begin using the autocall macros.
Although the MAUTOLOCDISPLAY system option is not required, it displays the
source location of the autocall macros in the SAS log when the autocall macro is
invoked. For more information, see “MAUTOLOCDISPLAY System Option” on page
357.
172 Chapter 12 Macro Language Elements
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset