I have sas 9.4 installed on drive C and all data on drive F. How to make sas not create temporary files on drive C only on F. Drive F is much faster.
Best regards and thank you in advance for your help.
Change the location of the WORK libref.
The location of the WORK libref is specified in the standard installation location
in line line
You can specify your own folder by a couple of ways
Example:
Change TEMP
The SAS icon on my desktop taskbar has property target as the command
"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg"
Edit the target so that the environment variable TEMP is changed for the SAS session that is launched.
"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg" -set TEMP D:\TEMP
Starting SAS from the icon will now have a different folder for WORK
2 libname WORK list; NOTE: Libref= WORK Scope= Kernel Engine= V9 Access= TEMP Physical Name= D:\TEMP\SAS Temporary Files\_TD3944_HELIUM_ Filename= D:\TEMP\SAS Temporary Files\_TD3944_HELIUM_
...
If you are presuming WORK means the default library when only the member name is coded (one-level SAS data set name), then you can use the USER option to specify which library to use in such cases.
Example:
libname FASTER 'F:\TEMP'; options USER=FASTER; data class; set sashelp.class; run;
----- LOG -----
5 options USER=FASTER; 6 7 data class; <------------- one-level name 8 set sashelp.class; 9 run; NOTE: There were 19 observations read from the data set SASHELP.CLASS. NOTE: The data set FASTER.CLASS has 19 observations and 5 variables. <---- USER= adjusted one-level name NOTE: DATA statement used (Total process time): real time 0.02 seconds cpu time 0.01 seconds
All of the advice that you have received so far is good advice.
Sometimes, however, depending on your company's policies, certain things like editing config files aren't always possible.
One other option is to run your program in "batch" mode (instead of interactive). The command varies by environment (Windows, Unix, Mainframe, etc.). Here's an example from Windows where I've created a little .bat file which, when double-clicked, launches my SAS job in batch mode with all the parameters that I have specified:
set env=production
::set env=development
sas -set environment %env% -set lPwd_PASSWORD XXXXXXXX -memsize 32G -work N:\Work -logparm "rollover=session write=immediate" -log C:\Users\XXXXXXXX\Documents\SAS\Pgm\Test\Hive_Grid\logs\Join_Members-tblMMR0323_Restated_MONO_#Y-#m-#d_#H-#M-#s_#p.log -sysin C:\Users\XXXXXXXX\Documents\SAS\Pgm\Test\Hive_Grid\Join_Members-tblMMR0323_Restated_MONO.sas -nostatuswin -noterminal -nosplash -noicon
pause
Some of the parameters I'm using in the above example:
You don't have to code all of these parameters, Logparm for example is not essential; this is just an example.
All that to say, sometimes it's better to submit via batch when you need to have a little more control over parameters that must be set at start up.
Jim
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.