BookmarkSubscribeRSS Feed
Ihsan-Mahdi
Quartz | Level 8

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 🙂

7 REPLIES 7
Kurt_Bremser
Super User

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).

Ihsan-Mahdi
Quartz | Level 8
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!
Reeza
Super User

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';
Ihsan-Mahdi
Quartz | Level 8
Thank you! I will try this
SASKiwi
PROC Star

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>'

PaigeMiller
Diamond | Level 26

@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.

--
Paige Miller
Ksharp
Super User
/*
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: Call for Content

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!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 7 replies
  • 1672 views
  • 7 likes
  • 6 in conversation