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

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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