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
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: