Chapter Contents |
Previous |
Next |
SAS Macro Language: Reference |
The stored compiled macro facility compiles and saves compiled macros in a permanent catalog in a library that you specify. This compilation occurs only once. If the stored compiled macro is called in the current or later sessions, the macro processor executes the compiled code.
Compiling and Storing a Macro Definition |
To compile a macro definition in a permanent catalog, create and save the source for each stored compiled macro. To store the compiled macro, follow these steps:
%macro myfiles / store des='Define filenames'; filename file1 'external-file-1'; filename file2 'external-file-2'; %mend;
mylib.sasmacro.myfiles.source
libname mylib 'SAS-data-library'; options mstored sasmstore=mylib;For more information, see SASMSTORE in Chapter 13.
You cannot move a stored compiled macro to another operating system.
You can, however, move the macro source code to another operating system where
you can then compile and store it. You may need to recompile these macros
if you use them in a different release of the SAS System. For more information,
see your host companion.
If you use the macros in the autocall library supplied by SAS Institute, you can save macro compile time by compiling and storing those macros in addition to ones you create yourself. Many of the macros related to base SAS software that are in the autocall library supplied by the Institute can be compiled and stored in a SAS catalog named SASMACR by using the autocall macro COMPSTOR that is supplied by SAS Institute. For more information, see COMPSTOR in Chapter 13.
Calling a Stored Compiled Macro |
Once you have set the required system options, calling a stored compiled macro is just like calling session compiled macros. However, it is important that you understand how the macro processor locates a macro. When you call a macro, the macro processor searches for the macro name using this sequence:
You can display the entries in a catalog containing compiled macros. For more information, see Chapter 10.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.