Help using Base SAS procedures

How to recover unsaved codes?

Frequent Contributor
Posts: 100

How to recover unsaved codes?

Hi there:

Accidentally closed my SAS session. Did not save anything before this happened unexpectedly. (Yes I should have, even as a new SAS user! Was too absorbed following along the SAS online training...)

Is there any hope to recover my SAS code, or even just the log? (I'm using windows xp...)

Is there a way to have SAS autosave the codes like in Excel?

Thank you. I will try to remember my lesson but might not succeed all the time.
Valued Guide
Posts: 632

Re: How to recover unsaved codes?

Short answer: Maybe.

Enhanced Editor code is saved every 10 minutes (by default). The location is hard to remember, but is described in

You can change the location using the autosaveloc= system option.
Frequent Contributor
Posts: 100

Re: How to recover unsaved codes?

Thank you!
The short story is I was able to recover the codes.
In case this might help someone in the future, here is the long report.

I went to the support link. Almost gave up my hope as I read "Note that the backup files are deleted when the Enhanced Editor window containing the SAS program code is closed or you exit SAS. "

But I was still curious about the file location. Followed the instruction and found the $AS file. Tried to open it with SAS. Got an error message telling me the file did not exist...

In the end found out I could open it with text editor programs (notepad etc).
Happy ending.
Occasional Contributor
Posts: 10

Re: How to recover unsaved codes?



had you changed the extension  from .$as to .SAS  (after copying it to another location so as not damage the original file) you could have opened normally as any other sas program (because you said that you had to use a text editor).

Senior User
Posts: 1

Re: How to recover unsaved codes?

it worked, thanks
Ask a Question
Discussion stats
  • 4 replies
  • 4 in conversation