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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.