A location for autosave backup files for the SAS® Enhanced Editor depends on the SAS® Software release and the Microsoft Windows operating system


By default, the contents of each SAS Enhanced Editor window are saved in an autosave backup file of your SAS® program every 10 minutes. (You can manually change this time interval, as discussed in the Changing the Time Interval section of this SAS KB article.)

An example of the backup filename is shown here, where file-name is the name of the SAS program that is open in the editor. Note, too, that the string "9999AAAA-9BAA-BB9A-123A-888BDDDAAA" is just an example and is different for each file:

Important Note: The autosave backup files are deleted when the Enhanced Editor window that contains the SAS program code is closed or when you exit SAS normally. If SAS terminates abnormally, the backup autosave files might not be deleted.

The default location for the autosave backup files depends both on the release of SAS that is installed and on your specific Microsoft Windows operating system and the values for the %TEMP% and %APPDATA% environment variables.

Locating the File on Any Release of SAS®

One way to locate autosave files with the .$as extension is to search your entire C:\ drive, including searching hidden files and folders (see below), for files that start with AUTOSAVE of* or search for files with a .$as extension. Then, search any other drives specified by your %TEMP% and %APPDATA% environment variables for files that start with AUTOSAVE of* or for files with the .$as extension. 

Note: To determine your %TEMP% location, in the Windows Search box, type %TEMP% and press the Enter key. A File Explorer window is opened to the TEMP location designated on your machine. To determine your %APPDATA% location, in the Windows Search box, type %APPDATA% and press the Enter key. A File Explorer window is opened to the APPDATA location designated on your machine.

Another way is to work with your organization's IT department. They might be able to use Microsoft Windows File Recovery App.

An additional way is to check the default folder location as described below.

Locating the File on SAS® 9.2, SAS® 9.3, and SAS® 9.4 Systems

In the following paths, user-ID is the Windows user name that is used to log on to the machine.

Alternately, if SAS cannot access the location above, the autosave files are stored in the TEMP environment variable location. To view these files, in the Windows Search box, type %TEMP% and press the Enter key. The File Explorer window opens to the TEMP location designated on your machine. Examples for SAS 9.2, SAS 9.3, and SAS 9.4 are as follows:

Searching Hidden Folders on Microsoft Windows operating environments

To search hidden folders, do the following:

  1. In the Search box, enter File Explorer Options and press Enter.
  2. The Folder Options dialog box appears. If the View tab is not already showing, click the tab.
  3. In the list of files and folders, find Hidden files and folders and select Show hidden files, folders, and drives.
  4. Click Apply if it is not grayed out and click OK. If Apply is grayed out, just click OK.

Locating the File on SAS® 9.1 Systems

In the following, user-ID is the Windows user name that is used to log on to the machine.

To search hidden folders, click Advanced Search and select Include non-indexed, hidden, and system files.

If SAS cannot access the location, the autosave files are stored in a temporary location, as shown here for SAS 9.1:
C:\Documents and Settings\user-ID\Local Settings\Temp

Locating the File on SAS®8 Systems

In SAS 8, the Enhanced Editor autosave files are saved to the location that is defined by the Microsoft Windows TEMP environment variable.

Typically, for Windows XP, the location is as follows: 
C:\Documents and Settings\user-ID\Local Settings\Temp

However, by default, this directory is hidden in a Windows 2000 system. To see all hidden files and folders, do the following:

  1. Open Windows Explorer or My Computer. Select Tools ► Folder options.
  2. Click the View tab.
  3. Select Show hidden files and folders and click Apply.

To determine the TEMP location, see SAS Note 4816, "Enhanced Editor autosave feature creates a file: autosave of filename.$as."

Changing the Time Interval

To manually change the default 10-minute time interval, do the following:

  1. Select Tools ► Options ► Preferences ► Edit.
  2. In the Preferences dialog box, make sure that Autosave is selected and then change the time.

You can also change the time interval by adding the WAUTOSAVE command to the sasv9.cfg file. Note: Discussions about the WAUTOSAVE command in online SAS® 9.1.3 documentation still refer to the TEMP autosave location.

Possible Alternative to Use That Includes File Version Control

SAS® Studio includes integration with Git, a system for tracking changes and managing version control among multiple users. Git can be used with many different repository hosting services such as GitHub and Bitbucket. Refer to Understanding Git Integration in SAS Studio 5.2.

You can also interact with a Git repository from SAS by using SAS Git functions in a SAS program. For more information, see Using Git Functions in SAS in SAS Functions and CALL Routines: Reference.