Usage Note 33075: How to create a stored compiled macro library
A stored compiled macro library can be created using the MSTORED and SASMSTORE system options along with the STORE option on the %MACRO statement. MSTORED simply enables the use of stored compiled macros, where SASMSTORE= specifies the libref that references the SAS library where the catalog of stored compiled macros is stored or will be stored. The STORE option on the %MACRO statement stores the compiled macro as an entry in a SAS catalog SASMACR in the library referenced by the SASMSTORE= system option.
Here is an example:
/* the libref MYMACS points to the SAS library where the
stored compiled macro is to be stored */
LIBNAME MYMACS ‘C:\MACROS’;
OPTIONS MSTORED SASMSTORE=MYMACS;
%MACRO TEST / STORE;
code;
%MEND;
The above code will compile the macro TEST and store it in a catalog called SASMACR in the SAS library MYMACS.
The following syntax can be used to invoke the macro in a subsequent SAS session.
LIBNAME MYMACS ‘C:\MACROS’;
OPTIONS MSTORED SASMSTORE=MYMACS;
%TEST
Important: It is important to know that once a macro has been compiled, there is no way to retrieve the code. It is recommended that the SOURCE option be used along with the STORE option to ensure the code is not lost. See the following link for more information on the SOURCE option.
Click here to go to SAS Note 22352
The link below will take you to the %MACRO statement.
Click here to read about the %MACRO statement
Operating System and Release Information
SAS System | Base SAS | z/OS | | |
OpenVMS VAX | | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | | |
Microsoft Windows XP 64-bit Edition | | |
Microsoft® Windows® for x64 | | |
OS/2 | | |
Microsoft Windows 95/98 | | |
Microsoft Windows 2000 Advanced Server | | |
Microsoft Windows 2000 Datacenter Server | | |
Microsoft Windows 2000 Server | | |
Microsoft Windows 2000 Professional | | |
Microsoft Windows NT Workstation | | |
Microsoft Windows Server 2003 Datacenter Edition | | |
Microsoft Windows Server 2003 Enterprise Edition | | |
Microsoft Windows Server 2003 Standard Edition | | |
Microsoft Windows XP Professional | | |
Windows Millennium Edition (Me) | | |
Windows Vista | | |
64-bit Enabled AIX | | |
64-bit Enabled HP-UX | | |
64-bit Enabled Solaris | | |
ABI+ for Intel Architecture | | |
AIX | | |
HP-UX | | |
HP-UX IPF | | |
IRIX | | |
Linux | | |
Linux for x64 | | |
Linux on Itanium | | |
OpenVMS Alpha | | |
OpenVMS on HP Integrity | | |
Solaris | | |
Solaris for x64 | | |
Tru64 UNIX | | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Date Modified: | 2009-07-23 15:59:46 |
Date Created: | 2008-08-27 11:20:00 |