Hi everybody,
As far as I know, one can retrieve the source code of the complied macro using the following code, but only,
if the macro was stored with the option /STORE SOURCE.
%COPY <macro name>/SOURCE ;
Is there any chance to get the source code when the macro was compiled and only /STORE option was used?
I received a macro catalog with older entries (some macros from 1999) and not all corresponding macro programs exist.
Thank you in advance,
Natalie
As long as the macro was not compiled with the secure option then you can retrieve the source code by reading the catalog entries:
libname mcat "/path/to/catlog/dir";
filename mcat catalog "mcat.sasmacr.nonsecure.macro"; *[libname].sasmacr.[macname].macro ;
data _null_;
infile mcat;
input;
list;
run;
EDIT: This is documented in the %MACRO Statement of the SAS Macro Language Reference Manual
Hi Matthew,
thanks, the sas code worked fine, but the content in LOG was unfortenately not readable
(I tired it on one of my own macros, which were defentely not stores in secure mode)
This is what I get in LOG (very confusing):
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
1 CHAR ......CHECK_VARIABLES...................PL..9.2 ........................ ...
ZONE 00000044444554544444500000000000000000005400323222220000000000000000000010002000
NUMR 1000F03853BF612912C5300000000000000000000C009E2000000000400000000000100000000000
81 ....+...€...°...>................... 116
ZONE 000020008000B00030000000000000000000
NUMR B100B0000E000000E0000000000000000000
2 CHAR ........_CHECKDATASET........................... 48
ZONE 000000005444444454545000000000000000000000000000
NUMR 200000D0F3853B4141354000000000000000000000000000
Natalie
You have to dig.
You might also look up the LIST command to understand the output created.
Or did you try : options mprint mlogic symbolgen ;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.