BookmarkSubscribeRSS Feed
rajeshm
Quartz | Level 8

session compiled macro

Macro created and able to invoke and getting the result of  macro But enhance editor closed mistakenly.

Question:  How to get the source code of my macro  (As session not closed, entry in the catalog exists)

3 REPLIES 3
Reeza
Super User

Or call macro with mprint source symbolgen options. A bit of work to decipher but better than losing it all.

AndrewHowell
Moderator

It depends on how you compiled/stored the macro. "session compiled macro" is not specific enough for us to tell how you compiled it:

  • Did you just compile the macro (without the /store option) to the WORK.SASMACR catalog? If so, you might be in trouble.
  • Did you store it in a non-WORK catalog, using the MSTORED option, and %macro xyz / store option? If so you might be in luck.


Another thought - why did the Enhanced Editor close suddenly? If SAS crashed, it may not have cleared your WORK folder, so you might at least be able to retrieve the sasmacr.sasb7cat file and stick it somewhere where you could re-invoke the macro and examine the log (as explained in 's reply.


Other suggestions to avoid future repetition:

  • Set your SAS startup options to have an ALTLOG keep a copy of everything you generate. (But remember to purge it periodically..)
  • Keep your macros as *.sas files somewhere whilst developing
  • Anyone with other macro best-practice suggestions?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 824 views
  • 0 likes
  • 3 in conversation