BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
texasmfp
Lapis Lazuli | Level 10

After days of working out some code, I had the unfortunate luck of getting the Windows blue screen of death.  This happened before I could save the SAS file.  Unfortunately, there is no saved log file either.  I can see that the SAS temporary folder is still on the drive (E:\SAS Temporary Files\_TD2656_DESKTOP-575EP3T_).  Inside I see a macro catalog (sasmac2.sas7bcat) and inside that I can see the macro I need (Doit3).  If only I could open or view the contents, it would save me a day at least.  However, when I click on it I get a pop up box that says "No Default action for the macro data type".  Is there any way to see the contents?  If not, is there any other place that SAS or Windows may have saved a temporary file which may contain the code?

 

Thanks,

Base SAS 9.4 in Windows

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @texasmfp,

 

If the code was in the Enhanced Editor when the system crashed and you had the Autosave feature enabled (see Tools → Options → Preferences… → Edit), the last saved copy should (typically) be available in C:\Users\username\AppData\Roaming\SAS\EnhancedEditor\Autosave of programname.$AS, which is a text file that can be opened, e.g., with Notepad. (For the SAS-6-style Program Editor the location of the saved code is different, but the Autosave setting in the Preferences applies to it as well.)

 

With the sasmac2.sas7bcat file copied into the WORK library of a new SAS session you could try

filename myref catalog 'work.sasmac2.Doit3.macro';

data _null_;
infile myref;
input;
put _infile_;
run;

but the macro statements (%IF, %DO, %END, etc.) will not be human readable. However, if you used the SOURCE option of the %MACRO statement, the %COPY statement might come to the rescue, as suggested in Re: Extracting a macro code from Catalog File.

 

Good luck!

View solution in original post

3 REPLIES 3
FreelanceReinh
Jade | Level 19

Hello @texasmfp,

 

If the code was in the Enhanced Editor when the system crashed and you had the Autosave feature enabled (see Tools → Options → Preferences… → Edit), the last saved copy should (typically) be available in C:\Users\username\AppData\Roaming\SAS\EnhancedEditor\Autosave of programname.$AS, which is a text file that can be opened, e.g., with Notepad. (For the SAS-6-style Program Editor the location of the saved code is different, but the Autosave setting in the Preferences applies to it as well.)

 

With the sasmac2.sas7bcat file copied into the WORK library of a new SAS session you could try

filename myref catalog 'work.sasmac2.Doit3.macro';

data _null_;
infile myref;
input;
put _infile_;
run;

but the macro statements (%IF, %DO, %END, etc.) will not be human readable. However, if you used the SOURCE option of the %MACRO statement, the %COPY statement might come to the rescue, as suggested in Re: Extracting a macro code from Catalog File.

 

Good luck!

texasmfp
Lapis Lazuli | Level 10
Thanks, both the autosave and the code worked, but unfortunately neither was the latest version. Much thanks

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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