Hello. Does anyone have code to redirect SAS temporary files? My C drive is running out of space but I have other drives with enough space left.
Thankyou 🙂
This is set in the configuration file for the SAS session. The location of the configuration file depends on the way SAS is used (workspace server with SAS Studio or Enterprise Guide, or native with Display Manager).
Create a library called USER. SAS will then default all WORK tables to this library instead.
You will need to manually delete the files in this library when you're done with it.
libname user 'C:\path to save files';
If you are running SAS on a PC using the SAS Windowing Environment then you can create a program short cut including the command: sas.exe -work '<My new path>'
@Ihsan-Mahdi wrote:
Thank you for responding! I don't have permission to change the configuration file so I was hoping to obtain code that would redirect temporary files temporarily so to speak!
Where I work, we can't change the default CONFIG file. But you can copy it to a place where you do have permission to change it, so you can add in the option now. Then change the startup options to point to this copied CONFIG file (if you are using Windows, you do this in the shortcut that launches SAS, assuming you are using base SAS 9.4), not the original CONFIG file.
/*
1)The best way is change config file.
Add the following command in SASV9.CFG .
-work 'd:\temp'
2)Also you could try the following code to redirect WORK library.
*/
libname x v9 'd:\temp\';
options user=x;
data class;
set sashelp.class;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.