DATA Step, Macro, Functions and more

SAS compiled macro

Reply
Occasional Contributor Rik
Occasional Contributor
Posts: 12

SAS compiled macro

Hi,

Is there any way to retrieve the actual code of a compiled macro?
Super Contributor
Posts: 260

Re: SAS compiled macro

1) If the macro has been compiled with the SOURCE option, you can list the source in the Log window with [pre] %COPY yourMacroName / SOURCE LIB=library ;[/pre]
2) If 1) does not work, you're stuck.

Regards,
Olivier
SAS Employee
Posts: 58

Re: SAS compiled macro

Olivier is correct. You cannot recreate the source statements from a compiled macro UNLESS it was created using the SOURCE option. If it was, you can then retrieve it using the %COPY statement as below.

One thing I will add is that by using the OUTFILE= option with the %COPY statement, the output can be directed to a file instead of the SAS Log.
SAS Employee
Posts: 58

Re: SAS compiled macro

Oops, should have said "as above". Did not know new postings went at the bottom!
Ask a Question
Discussion stats
  • 3 replies
  • 136 views
  • 0 likes
  • 3 in conversation