Chapter Contents

Previous

Next
SAS Companion for the CMS Environment

Stored Compiled Macro Facility

The stored compiled macro facility gives you access to permanent SAS catalogs that contain compiled macros. The purpose of the stored compiled macro facility is to improve efficiency in the execution of production jobs. In order for SAS to use stored compiled macros, the SAS system option MSTORED must be in effect. In addition, you use the SAS system option SASMSTORE= to specify the libref of a SAS data library that contains a catalog of stored compiled SAS macros. For more information about these options, see System Options in the CMS Environment and SAS Language Reference: Dictionary.

Using stored compiled macros offers the following advantages over other methods of making macros available to your session:

Because you cannot re-create the source statements from a compiled macro, you must save the original macro source statements.

Using the stored compiled macro facility is the most efficient way to make macros accessible to your SAS session. However, you can use these approaches:


Accessing Stored Compiled Macros

The following example illustrates how to create a stored compiled macro in one session and then how to use the macro in a later session.

/* Create stored compiled macro */
libname mylib 'mylib a';
options mstored sasmstore=mylib;
%macro myfiles / store;
   filename file1 'first mylib a';
   filename file2 'second mylib a';
%mend;

/* Use stored compiled macro later */
libname mylib 'mylib a';
options mstored sasmstore=mylib;

%myfiles
data _null_;
   infile file1;
      ...statements reading input FILE1...
   file file2;
      ...statements writing output FILE2...
run;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.