Usage Note 22352: I have a compiled macro that is stored in a catalog that I would like to modify. How do I retrieve the original code so that I can make changes?
There is no way to retrieve the original source code from a stored compiled macro. You must always save the original code in another file so that you can modify it later.
Starting with SAS® 9.1, there is a new SOURCE option for the %MACRO statement. When used with the existing STORE option, the SOURCE option combines and stores the source of the compiled macro. The compiled macro code becomes an entry in a SAS catalog in a permanent SAS data library. The compiled macro and the source code are stored together in the same SASMACR catalog. The SOURCE option requires that the STORE option and the SAS option MSTORED be set. You can use the SAS option SASMSTORE= to identify a permanent SAS data library. You can store a macro or call a stored compiled macro only when the SAS option MSTORED is in effect.
Note: The source code that is saved by the SOURCE option begins with the %MACRO keyword and ends with a semicolon following the %MEND statement. Now that you have a way to store the source code with the SOURCE option, you also need a way to retrieve this information. The answer is the new %COPY statement, which copies specified items from a SAS macro library. For example:
libname test 'c:\';
options mstored sasmstore=test;
%macro test(arg) / store source des="test of the source option";
%put arg = &arg;
data one;
x=1;
run;
%mend test;
%copy test / source;
Operating System and Release Information
*
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.
Type: | Usage Note |
Priority: | low |
Topic: | SAS Reference ==> Macro
|
Date Modified: | 2013-07-17 14:35:47 |
Date Created: | 2002-12-16 10:56:44 |