Desktop productivity for business analysts and programmers

Permanently Change WORK folder location

Reply
New Contributor
Posts: 4

Permanently Change WORK folder location

Hello,

 

Is there a way to permanently change the WORK location from my C drive temp folder to another folder say on a shared drive? Or a different hard drive?

 

Cheers,

Super User
Posts: 11,105

Re: Permanently Change WORK folder location

What is the reason for wanting a different location for the work library? T

 

 

New Contributor
Posts: 4

Re: Permanently Change WORK folder location

I am dealing with large data and the temporary files are eating up my HHD space to the point that I run out of space in some instances.

 

So my choices are (1) Buy a bigger HDD. (2) Change the WORK folder to a network that has the space. (3) Buy a server version of SAS which is very expensive.

 

Option 2 seems the easiest and cheapest by far if doable.

Super User
Posts: 11,105

Re: Permanently Change WORK folder location

If you have access to a network drive then create a permanent library there and just remember to use the LIBRARY.DATASET notation in code or point to the library as needed. If you can map a drive letter (Windoze) to the network location then creating the library is easy after mapping the drive letter:

 

libname mylib "X:\"; for example.

Just make sure that the drive and the library are available to your projects.

 

Note that network drives may have performance issues depending on traffic.

Super User
Posts: 9,856

Re: Permanently Change WORK folder location

Before run you code , add this line .

Or you could add this line in AUTOEXEC file .

 

options user='d:\temp\';

 

 

 

Super User
Posts: 19,030

Re: Permanently Change WORK folder location

Note that you'll be giving up significant speed if you start working off of a network drive versus your local HD.  Especially if the files are big, you are effectively reading and writing a large amount of data across your network. 

 

Rather than a permanent setting, I would recommend using the user library option that @ksharp has recommended.

 

If you set up a library with the name user, SAS treats that as the WORK library instead of work, and you don't need to use a two level (libname.dataset) naming system.

Ask a Question
Discussion stats
  • 5 replies
  • 403 views
  • 2 likes
  • 4 in conversation