DATA Step, Macro, Functions and more

If macro is not stored (it was not use "/store source" when the macro was created ) in SAS can i see the code of the macro somehow?

Reply
Occasional Contributor
Posts: 7

If macro is not stored (it was not use "/store source" when the macro was created ) in SAS can i see the code of the macro somehow?

If macro is not stored (it was not use "/store source" when the macro was created ) in SAS can i see the code of the macro somehow?

Trusted Advisor
Posts: 1,909

Re: If macro is not stored (it was not use "/store source" when the macro was created ) in SAS can i see the code of the macro somehow?

Posted in reply to DejanPeeski

The macro would have to be saved as a .SAS program (which is just a text file), in which case the SAS Program Editor, or the SAS ENhanced Editor, or any text editor, can show you the macro code.

Occasional Contributor
Posts: 7

Re: If macro is not stored (it was not use "/store source" when the macro was created ) in SAS can i see the code of the macro somehow?

Posted in reply to PaigeMiller

The problem is that i have the macro only as a SAS Catalog.

Respected Advisor
Posts: 3,799

Re: If macro is not stored (it was not use "/store source" when the macro was created ) in SAS can i see the code of the macro somehow?

Posted in reply to DejanPeeski

You can look in the catalog with INFILE/INPUT.  If the macro is mostly SAS Code you will see lots of stuff that you recognize.  Otherwise you will need to reverse engineer the compiled bits.  Change work.sasmac1 to your catalog and EXT...NAME to the macro name.

filename FT66F001 catalog 'work.sasmac1';
data _null_;
  
infile FT66F001('EXTENDVALIDMEMNAME.macro');
   input;
  
list;
  
run;
Ask a Question
Discussion stats
  • 3 replies
  • 248 views
  • 0 likes
  • 3 in conversation