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

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