Hello,
I inherited some code that has some macros in it that I do not know exactly what they do. Also, I don't know where the code for these macros is stored. How do I find it? also, when I run the code with the mystery macros in it, I don't get details of the macro's execution in the log. Is there a way to enable it?
Thanks.
See Bruno's answer here for part of that.
https://communities.sas.com/t5/SAS-Programming/Finding-Location-of-SAS-Macros/td-p/292642
Hello,
It could be the creator of these macros uses the STORED COMPILED MACRO FACILITY.
That saves the compiled macros to a catalog in a (permanent) library upon submitting the macro definition. You cannot open and read such a compiled macro catalog entry.
Check
proc options group=macro; run;
to see if mstored and sasmstore= are "activated".
To get info on the macro execution in the LOG, put these options before the macro call.
options mprint mlogic symbolgen;
Koen
If you can actually run the macros and they are using SAS autocall then this macro might help.
https://github.com/sasutils/macros/blob/master/maclist.sas
So run your macro, let's pretend it is named MYMACRO, then run the MACLIST macro and then look at the dataset it generated.
%mymacro;
%maclist;
proc print data=maclist;
run;
This is a common challenge when debugging applications. To avoid this kind of problem in the future, you might want to consider the SASjs approach - where all source code is managed locally, in a GIT repository, and jobs / services / tests are deployed as self contained units - ie, all dependent macros are 'compiled' into a single program, without any need for SASAUTOS or Catalogs or suchlike.
More info here: https://sasjs.io/resources/#other-useful-websites
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.