BookmarkSubscribeRSS Feed
Datino
Obsidian | Level 7

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.

4 REPLIES 4
sbxkoenk
SAS Super FREQ

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

Tom
Super User Tom
Super User

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;
AllanBowe
Barite | Level 11

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

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

sas-innovate-white.png

Register Today!

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.

Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1356 views
  • 4 likes
  • 5 in conversation