How can I see the source code for the sas macro?

I am trying to debug code used in a SAS program, but the program uses macros from a persistent library. I cannot find the code that created the macros, and I do not have access to the person who created the original library. I know that it option mprint;will show me the lines of code that the macro executes, but I would like to see all the code that the macro uses so that I can debug it more easily. In other words, I would like to have all the information that would be available to me if I had an original program that generated macros. Is it possible?

+4
source share
2 answers

There are two possible ways to execute a SAS macro from a persistent library. Either you use an autorun macro or a saved compiled macro.

The autocall macro will mean that you have access to the source because it is just a .sas file with a macro name as the file name. You can% include the file and see the full text, assuming that you know in which directory it is located (you may have many autocomplete libraries). Therefore, if your directory SASAUTOS c:\sas\macros\and you are calling %mymacro(), you can execute

%include "c:\sas\macros\mymacro.sas";

which will include precompiled text, and as long as you enable the option source2, it will be printed in your journal.

, SOURCE. , ( , SCM).

SOURCE, %COPY SCM :

%copy mymacro / SOURCE;

SAS .

+6

, options MAUTOLOCDISPLAY; , .

0
source

All Articles