BookmarkSubscribeRSS Feed
Natalie
Calcite | Level 5

Hi everybody,

As far as I know, one can retrieve the source code of the complied macro using the following code, but only,

if the macro was stored with the option /STORE SOURCE.

%COPY   <macro name>/SOURCE ;

Is there any chance to get the source code when the macro was compiled and only /STORE option was used?

I received a macro catalog with older entries (some macros from 1999) and not all corresponding macro programs exist.

Thank you in advance,

Natalie

4 REPLIES 4
FriedEgg
SAS Employee

As long as the macro was not compiled with the secure option then you can retrieve the source code by reading the catalog entries:

libname mcat "/path/to/catlog/dir";

filename mcat catalog "mcat.sasmacr.nonsecure.macro"; *[libname].sasmacr.[macname].macro ;

data _null_;

infile mcat;

input;

list;

run;

EDIT:  This is documented in the %MACRO Statement of the SAS Macro Language Reference Manual

SAS(R) 9.2 Macro Language: Reference

Natalie
Calcite | Level 5

Hi Matthew,

thanks, the sas code worked fine, but the content in LOG was unfortenately not readable Smiley Sad

(I tired it on one of my own macros, which were defentely not stores in secure mode)

This is what I get in LOG (very confusing):

 

RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8

1 CHAR ......CHECK_VARIABLES...................PL..9.2 ........................ ...

ZONE 00000044444554544444500000000000000000005400323222220000000000000000000010002000

NUMR 1000F03853BF612912C5300000000000000000000C009E2000000000400000000000100000000000

81 ....+...€...°...>................... 116

ZONE 000020008000B00030000000000000000000

NUMR B100B0000E000000E0000000000000000000

2 CHAR ........_CHECKDATASET........................... 48

ZONE 000000005444444454545000000000000000000000000000

NUMR 200000D0F3853B4141354000000000000000000000000000

Natalie

data_null__
Jade | Level 19

You have to dig.

You might also look up the LIST command to understand the output created.

Ksharp
Super User

Or did you try :    options mprint mlogic symbolgen ;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 5766 views
  • 1 like
  • 4 in conversation