Architecting, installing and maintaining your SAS environment

Changing the Drive for the WORK directory with Windows 10 and SAS 9.4

Reply
Occasional Contributor
Posts: 5

Changing the Drive for the WORK directory with Windows 10 and SAS 9.4

Hello,

 

I am using Windows 10 and SAS 9.4.

 

SAS is running on my c: drive, but I would like the WORK directory to be on my d: drive.

 

How do I accomplish this?

 

Thank you and sincere regards.

Moderator
Posts: 252

Re: Changing the Drive for the WORK directory with Windows 10 and SAS 9.4

There's lots of different ways, depending on what you allowed to re-configure. (Some work sites lock down config files on workstations.)

Ideally, look for the sasv9.cfg file in (or under) your $SASHOME folder - this will have an option something like

-WORK "C:\Temp"

 

which you can change.

 

Useful resources:

 

Occasional Contributor
Posts: 5

Re: Changing the Drive for the WORK directory with Windows 10 and SAS 9.4

Posted in reply to AndrewHowell

Thank you for trying.

 

When I change the .cfg file as you have suggested I get an error message, even when I point to a valid directory on my d: drive.  I tried the following within the sasv9.cfg file by replacing the existing option for -WORK:

 

–WORK "d:\sas temporary files"

 

ERROR: Unrecognized SAS option name d:\sas temporary files

ERROR: Unrecognized SAS option name -WORK

ERROR: (SASXKRN): KERNEL INITIALIZATION RESOURCE FAILED

ERROR: Unable to initialize the SAS Kernel

 

In the existing sasv9.cfg file the option for -WORK falls below a line that states "DO NOT EDIT BELOW THIS LINE" .  The -WORK option reads as follows:

-WORK "!TEMP\SAS Temporary Files" 

 

This results in the WORK library being allocated to my puny c: drive rather than my nice d: drive.

Super Contributor
Posts: 461

Re: Changing the Drive for the WORK directory with Windows 10 and SAS 9.4

Moderator
Posts: 252

Re: Changing the Drive for the WORK directory with Windows 10 and SAS 9.4

[ Edited ]
Posted in reply to ChrisBrooks

(config.sas - version 6? Is this what is now sasv9.cfg? I came in at v8.2..)


Still depends on whether or not the user can modify config files or if it's locked down.

Super User
Posts: 11,563

Re: Changing the Drive for the WORK directory with Windows 10 and SAS 9.4

Posted in reply to AndrewHowell

AndrewHowell wrote:

(config.sas - version 6? Is this what is now sasv9.cfg? I came in at v8.2..)


Still depends on whether or not the user can modify config files or if it's locked down.


 

With Windows you can make a new program Icon and modify the parameters to point to your custom sasv9.cfg.

Yes, this means that your custom config may not be used when some of the right-click and select options are chosen but works for most things.

 

 

Occasional Contributor
Posts: 5

Re: Changing the Drive for the WORK directory with Windows 10 and SAS 9.4

That is correct. config.sas is replaced with sasv9.cfg in version 9.4.
Occasional Contributor
Posts: 5

Re: Changing the Drive for the WORK directory with Windows 10 and SAS 9.4

Posted in reply to AndrewHowell
You are absolutely correct. And based on my attempts (see my post re: error messages above) it appears that the sasv9.cfg file is not easy to tinker with.
Occasional Contributor
Posts: 5

Re: Changing the Drive for the WORK directory with Windows 10 and SAS 9.4

Posted in reply to ChrisBrooks
Sadly it didn't work. see my post above regarding modify sasv9.cfg file error messages...
Trusted Advisor
Posts: 1,427

Re: Changing the Drive for the WORK directory with Windows 10 and SAS 9.4

Hello @knowlei,

 

I believe your dash sign (-WORK) is not the right one. I would just type it with your keyboard instead of copying and pasting it.

 

Once you are ready, save the config file and re-start your SAS session.

Super User
Posts: 8,062

Re: Changing the Drive for the WORK directory with Windows 10 and SAS 9.4

Posted in reply to JuanS_OCS

This is why we keep nagging people to post code in the correct manner with the {i} or little running man buttons. And to NEVER, EVER save code in a word processor.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Frequent Contributor
Posts: 134

Re: Changing the Drive for the WORK directory with Windows 10 and SAS 9.4

Posted in reply to KurtBremser
I would't be so drastic, *.docx is still a universal format that remain to be challenged. Another workaround is to disable some auto-correct features in Word like double-dash, upper case in 1st word etc. Or even use the [Ctrl+Z] shortcut to cancel the unwanted corrections on the fly.
Super User
Posts: 8,062

Re: Changing the Drive for the WORK directory with Windows 10 and SAS 9.4

How do you work with SAS? Do you use Enterprise Guide, or SAS with Display Manager?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 12 replies
  • 238 views
  • 9 likes
  • 7 in conversation