09-29-2017 02:04 PM
Hi. Can someone help me with code to re-direct the path for the SAS Temp Folder. I believe its currently in 'c' drive but I'd like to direct SAS to use an external drive to process and store the temp files. Any help would be greatly appreciated.
09-29-2017 03:14 PM
09-29-2017 02:56 PM
It is the -work option in the config file.
Where you find that config file depends on the type of your SAS setup. (Desktop, BI Server, ...)
09-29-2017 03:02 PM
This is possible but the approach may depend on how you run SAS as it requires changes to the initialization of the program and cannot be changed after SAS is started.
If you are running a standalone base SAS Display manager session you will need to find the configuration file which is likely to reside in someplace like
exact path will vary by version
You are looking for sasv9.cfg
Look for the -WORK line and change it to read similar to
where Path is a fully qualified system path (starts with a Drive letter in windows, or your mount point in others)
If your IT folks have locked down the Program files folder as in my organization you may not be able to save the config file in its current location. If that is the case then save it some where you control and then change or copy of the program icon to have the -CONFIG option point to your version. If your program icon doesn't then add -CONFIG "Pathtoconfig\sasvg.cfg" or what ever the path and name of the saved version you created.
If you have batch jobs you will need to make sure that the -CONFIG used in the command like uses the desired config file.
Other installs, I'm not sure of as I don't work in a server environment and more admin types may be involved.
09-29-2017 03:05 PM
I would assume you are using local SAS 9.1+ (not server version), and you have access to your local SAS folder.
1. Locate sasv9.cfg
you can just simply search it using OS or right click SAS icon check on properties, you may see something like:
"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg"
, that tells you where to locate the config file sasv9.cfg
2. Using text editor (e.g. notebook) open it and look for :-WORK “c:\whatever\”, then change it to where you want to route your temp file. Save the config file. restart SAS.
09-29-2017 03:14 PM
09-29-2017 03:18 PM
found it. Its currently -Work "!Temp\SAS Temporary Files" If I am wanting it to be changed to an external drive would I enter the code as follows: -Work "J:\extDrive\bigdata" Exactly like that?
Yes. And once that change is made, it will stay active until you change it back.
Need further help from the community? Please ask a new question.