Hi, I need help with a technical issue. My computer automatically shut down while I was coding in SAS Studio. I saved part of my code before the shutdown. But when I re-opened the file, all the contents were gone, but if I check the file size, it is about the same size as an old version. Can someone teach me how to recover the file to the last saved version?
Thank you!
There's nothing in that file, literally. It is just one big heap of hex 00's.
This looks like some kind of privacy software went over temporary files (on shutdown) to overwrite them with "nothing".
How did you store your program? .sas files are pure text and can be opened with any text editor for checking.
I stored it as xx.sas. I opened the file with a text editor, nothing changed. Still empty. The strange thing is that the size of the file suggests it should not be an empty file.
All depends where SAS Studio is running and where you have saved the program. So please add information about the environment you are working in.
You can find the files in a folder such as:
C:\Documents and Settings\PURMAH\Application Data\SAS\EnhancedEditor
File should be somewhere in a location like that. You'll likely have multiple folders and will have to find which one matches your previous session. Any session that crashes would have left files behind.
More details here:
http://support.sas.com/kb/12/392.html
@Lifang wrote:
I am using the enterprise environment. I will look into it. Thanks.
I did locate the EnhancedEditor folder but was not able to find the file there. I realized that I have saved the log of running most of the code before my computer shut down, so I was able to recover my code from the log. Thanks for your help. It would be nice to know why the original file turned blank.
EG does have a (bad) habit of destroying files when the connection to the storage is unreliable. I've witnessed several cases where .egp files were trashed that were opened on a workspace server, and where the connection died.
Similar things might happen if EG crashes fatally when it wants to rewrite a file's contents. File is already re-initialized, but further write fails.
Might be a shortcoming in the IOM protocol that is not robust against short connection drops or timeouts.
When working from the home office, EG often loses connection to servers, while the venerable (in fact ANCIENT) X-Windows over an openssh tunnel never does experience more than a slight delay.
@ChrisNZ wrote:
A way to avoid losing programs is to store them in external text files rather than in egp project files.
This is much less required than with earlier versions of EG but still a good precaution.
VERY solid advice. Everything important that I have created is stored as a .sas file on the server (AIX on top, so a VERY stable operating system).
Project files are always kept on internal desktop disks while I work on them. Only when I'm finished for the day I do copies to remote locations.
And I do "save early, save often". Every few lines of coding I hit the "store everything" button in EG.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.