Help using Base SAS procedures

Redirect paths

Accepted Solution Solved
Reply
Highlighted
Contributor
Posts: 61
Accepted Solution

Redirect paths

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. 


Accepted Solutions
Solution
3 weeks ago
Contributor
Posts: 61

Re: Redirect paths

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?

View solution in original post


All Replies
Super User
Posts: 7,422

Re: Redirect paths

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

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 61

Re: Redirect paths

Its a laptop and the conf file file is in my program files folder.   Its runniing SAS 9.4

Super User
Posts: 11,121

Re: Redirect paths

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

C:\Program Files\SASHome2\SASFoundation\9.4\nls\en

exact path will vary by version

You are looking for sasv9.cfg

Look for the -WORK line and change it to read similar to

 

-WORK= "Path\Folder"

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.

Respected Advisor
Posts: 3,156

Re: Redirect paths

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.

Solution
3 weeks ago
Contributor
Posts: 61

Re: Redirect paths

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?
Super User
Posts: 7,422

Re: Redirect paths


Suzanne_Ed wrote:
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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 61

Re: Redirect paths

Also, would I need to change back or would it automatically default back to its original path after shutting down?
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 222 views
  • 3 likes
  • 4 in conversation