BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jerry898969
Pyrite | Level 9

Hello,

Is it possible to redirect my work folder to a different location while in sas using sas statements?  I'm using sas 9.3.

I tried

options work="c:\temp";

That returns this warning

WARNING 11-12: SAS option WORK is valid only at startup of the SAS System or startup of a SAS process. The SAS option is ignored.

I will need to run this on a linux server using SAS/Connect.  I'm doing a proc ginside with census block data that has over 600 million rows so for this one process I want to redirect the temp space.

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
jerry898969
Pyrite | Level 9

Thank you both for your replies.  I was able to figure it out using a Linux application that allowed me to use this command

$ sas -work /home/data/temp temp.sas

My task was to find a way to do it in sas then the lead told me to use this approach.

Thank you both for your help

View solution in original post

5 REPLIES 5
Tom
Super User Tom
Super User

How are you making the SAS/Connect session?  If you are using one of the SAS provided scripts then you can modify the command used to launch SAS on the remote machine to include -work option.

But if you are just worried about WORK datasets then just create permanent data sets instead.

jerry898969
Pyrite | Level 9

Hi Tom,

I'm connecting using the signon statement.

When proc giniside runs it creates a temp table that is very large.  I want it to put that in a location where I have enough space for it to get as big as it needs.

Thank you

Tom
Super User Tom
Super User

I suspect that you want to change the UTILLOC option and not the WORK option.  As I said before you can control where the datasets are made by changing the name you use for them.  But the placement of intermediate files that a proc might create are controlled by the UTILLOC option.

If you are using a script with the SIGNON command then you can modify the script.  For example the default script for connecting via TCP to a Unix host includes this line.

   type 'sas -dmr -comamid tcp -noterminal ';

You can just make a modified version and use it in the SIGNON.

If you are using the SASCMD= option on the SIGNON then perhaps you can modify that command to include the UTILLOC option.

But if you are connecting to some SAS spawner then I think you would need to make changes there, which would be harder to do by a single user.  Perhaps the admin can create a separate service that you can connect to for these types of jobs?

jerry898969
Pyrite | Level 9

Thank you both for your replies.  I was able to figure it out using a Linux application that allowed me to use this command

$ sas -work /home/data/temp temp.sas

My task was to find a way to do it in sas then the lead told me to use this approach.

Thank you both for your help

Astounding
PROC Star

jerry,

You have certain complications here ... the SAS/Connect situation, and working storage as a procedure executes rather than storing a one-level data set name.  So you will need to test this to see if it actually works for you.

The general idea is that you set up a library yourself:

libname mystuff 'path to folder';

At any point in the program, you can specify:

options user=mystuff;

Automatically from that point forward, all single-level data set names get stored in MYSTUFF, instead of in WORK.  Later on, you can restore the original conditions:

options user=WORK;

The MYSTUFF folder will not get cleaned out automatically at the end of your program ...  you will need to manage that yourself.

Good luck.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 3432 views
  • 6 likes
  • 3 in conversation