BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Lena_PA
Fluorite | Level 6

I ran a simple Proc Sort comment and it did not run. Log file says the disk is full. I asked the administrator and he said I should run it in E drive (which has a plenty of space). 

So I tried the following code in SAS

 

Options Work =' E:\temp';

 

But received an error message " SAS option WORK is valid only at startup of the SAS System or startup of a SAS process. The SAS option is ignored."

 

It's a workstation with multiple users..

 

Can you please help?

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

I suggest you create a Windows program short cut with the command: sas.exe -work 'E:\temp' then use the short cut to open a SAS session. I'd suggest also checking the C drive for any old SAS WORK folders that can be deleted.  

View solution in original post

14 REPLIES 14
SASKiwi
PROC Star

I suggest you create a Windows program short cut with the command: sas.exe -work 'E:\temp' then use the short cut to open a SAS session. I'd suggest also checking the C drive for any old SAS WORK folders that can be deleted.  

Lena_PA
Fluorite | Level 6

Thank you so much! I think that's what my administrator did but I still receive the error message (no disk space). 

 

Local C drive is pretty small (110GB free) and my data set is 115GB.. (I know it's large). So I'm trying to redirect Work Library to E drive (2TB free).. 

Lena_PA
Fluorite | Level 6

If I add more, I've already deleted everything I could delete but I cannot delete other files since it's a shared workstation with multiple users 😞 

Quentin
Super User

I'm confused.  Did you create try the first part of @SASKiwi's suggestion:


create a Windows program short cut with the command: sas.exe -work 'E:\temp' then use the short cut to open a SAS session

?

 

When you did that , what do you see in the log if you submit:

%put %sysfunc(pathname(work)) ;

That will print the path to your work directory to the log.  It's a good way to confirm that the work directory is where you want to it be.  

 

If that shows that work is pointed to E:\temp, and you've got 2TB free there, is it still running out of space?  Maybe run your program until it runs out of space, and then check to see how much space is still free on E:  .   If you've got 20 data steps making copies of a 100GB dataset, it's definitely possible to fill up 2TB...  In that case you'll want to start deleting work datasets during your program, or avoid making multiple copies of the data by using views etc.

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
HenryKobus
Obsidian | Level 7

From my point of view the problem is free disk space (110 GB) is lower than dataset size (115GB). When SAS sorts it creates a new file with the extension ".lck" to write the observations in sorted order. When it's finished the unsorted file is deleted and the new file is renamed (cut off the trailing ".lck"). This means for a very short period of time you need the dateset size twice (2 x 115 GB). That's why you run in the "disk full condition".  My solution is create a library on E: , move (not copy) the unsorted dataset in there, sort it there and move it back or use the out= option in proc sort to write the sorted dataset on C: directly    

Lena_PA
Fluorite | Level 6

Thank you for your answer. 

 

All my data are in E drive to begin with (E drive has plenty of space, local C drive is not). But when I run Proc Sort, it gives me an error message saying no disk space in local C drive. That's why I'm confused. 

HenryKobus
Obsidian | Level 7

Understand. But then the solution provided by @SASKiwi in combination with the check provided by @Quentin should work. Maybe it's necessary to quote the full path to sas.exe (mind the double quotes & take your path not my 32bit one🤐 & the temp folder should exist already) in the shortcut - like this

"C:\Program Files\SASHome\x86\SASFoundation\9.4\sas.exe" -work "E:\temp" -autoexec "C:\Users\...\autoexec.sas" -config "C:\Users\...\sasv9en.cfg"

Quentin
Super User

@Lena_PA wrote:

Thank you for your answer. 

 

All my data are in E drive to begin with (E drive has plenty of space, local C drive is not). But when I run Proc Sort, it gives me an error message saying no disk space in local C drive. That's why I'm confused. 


When you run PROC SORT, the temp files it creates are created in your WORK library.  So if you haven't successfully pointed WORK to E:  (and this needs do be done during SAS startup), then this would make sense. 

 

This ts note describes different ways to redirect work: https://support.sas.com/kb/19/247.html

 

Also this prior thread: https://communities.sas.com/t5/Administration-and-Deployment/Changing-the-Drive-for-the-WORK-directo...

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
Kurt_Bremser
Super User

You actually need three times the size:

  1. original dataset
  2. utility file
  3. target dataset

Depending on the structure and the settings of COMPRESS system or dataset options, the utility file might even be much larger than the dataset(s), forcing one to use the TAGSORT option of PROC SORT.

Lena_PA
Fluorite | Level 6

I tried your suggestion 

%put %sysfunc(pathname(work)) ;

 

and SAS Log indicates that my work library is still in C drive.. so it means my administrator did not correctly redirect work library.. 😞 

 

It is really helpful though. I at least know the SAS shortcut did not redirect the work library..

 

Lena_PA
Fluorite | Level 6

So how may I execute this? Can I do that without an administrator permission? 

 

Sorry - I'm not very computer savvy..

Quentin
Super User

@Lena_PA wrote:

So how may I execute this? Can I do that without an administrator permission? 

 

Sorry - I'm not very computer savvy..


Instructions for modifying the shortcut to redirect the WORK library are in the tech support note I posted: https://support.sas.com/kb/19/247.html

 

See the end part:

How to redirect the SAS Work library in the SAS start-up command of the "SAS 9.x (English)" application shortcut

 

Note the first part of that page describes how to redirect WORK by updating your sasv9.cfg file, which is another option.

 

You could try both approaches.  If you're not an admin on the PC, it's possible both will be blocked.  But if you can get your admin back to do it, you can sit with them and the tech support note, and have them keep trying it until you can get %put %sysfunc(pathname(work)); to show that WORK has been redirected where you want.

 

As a side note, if E: is a remote network drive, you should expect SAS processing time might increase dramatically, because SAS does a lot of reading and writing to the WORK directory.  But, sometimes you have to pay that performance price if your local resources are constrained.

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
Kurt_Bremser
Super User

If your 115 G dataset resides on the C: drive, you cannot sort it "in place", as you need the same space for the temporary target dataset during the sort (the file which is named XXX.sas7bdat.lck and renamed to XXX.sas7bdat when the procedure terminates and the original file has been deleted).

Use the OUT= option to direct the target of the sort to storage with enough space.

Lena_PA
Fluorite | Level 6

I copied your comment and sent it to the administrator with SAS log file and he was able to do it right this time! Thank you!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 14 replies
  • 1491 views
  • 6 likes
  • 5 in conversation