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
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!
Do a Google search for "sas retrieve macro source code"; you might find some tips for retrieving the source code.
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!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.