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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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