The SAS® start-up errors "ERROR: Invalid physical name for library WORK", "ERROR: Insufficient authorization to access WORK library" and "ERROR: Library WORK does not exist" might require changing the location for the SAS Work library. Also, there are other reasons to change the SAS Work location, such as changing to a drive with more disk space available. The SAS Work library has to be defined prior to starting SAS. Once a SAS session is open, the SAS Work library cannot be reassigned within that SAS session. The SAS Work library contains temporary files that are used during a SAS session.
To determine the physical location of the SAS Work library within a SAS session, submit one of the following statements:
You can also verify the SAS Work library location used in the SAS session by using the SAS Explorer window. Double-click Libraries. Right-click Work and select Properties. The full path is displayed under Levels.
On Microsoft Windows operating systems, the SAS Work library is set to the default value of !TEMP/SAS Temporary Files where !TEMP is a Windows environment variable. To see the value for the !TEMP environment variable on your machine, in the Windows Search box enter COMMAND PROMPT and open the COMMAND PROMPT window. Then, enter the following:
set temp
If the specified SAS Work directory path does not exist or operating system file permissions deny access to the directory, any or all of the following messages might appear when you attempt to start SAS:
To redirect the Work library to a different physical directory location might require assistance from your IT department if permissions errors occur during the steps below. Take these steps:
The default location for this file is as follows:
For example, to save all temporary files to the D: drive, change the -WORK option in the sasv9.cfg file to the following:
-WORK "D:\SASWORK\SAS Temporary Files"
Each unique user account that launches SAS sessions on a shared machine requires its own respective Work library. One technique to separate Work libraries for multiple user accounts is to include the Windows environment variable !USERNAME in the specified directory path.
Here is an example:
To see the value for the environment variable !USERNAME, in the Windows Search box enter COMMAND PROMPT and open the COMMAND PROMPT window. Then, enter the following:
set username
Restart the SAS session to use the new Work location.
You can add the -WORK option to the SAS start-up command in the SAS 9.x (English) shortcut. After you edit the shortcut, launch SAS by selecting the application item or icon to use the new SAS Work library directory path.
For example, if you right-click the SAS 9.4 (English) shortcut icon and select Properties, the Shortcut tab might have the following Target option:
To change the SAS Work library location, add the -WORK option to this command:
Here is an example of the command-line syntax for a SAS deployment shared by multiple user accounts on a single machine: