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

I am running a program that takes days to run with lots of temporary files.  I realize that I made a mistake at the end of the program and that it will not complete.  It hasn't reached the mistake yet.  Is there a way for me stop it and keep the temporary files that have already run, fix the error and pick back up where I left off.  I know where my SAS work and util files are, but I have never actually tried to directly access these file before.  

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

"UTIL" files are not of interest. They are only created dynamically by a step and removed automatically once that step finishes. You can't reuse them in a new step. The only sensible thing you can do with them is to delete them to reclaim the disk space.

If you forcibly terminate the SAS process (kill -9 on a UNIX system), you prevent the automatic deletion of the WORK (and UTILLOC, if it is separate) directory.

I can only give you advice for finding your dead WORK on a UNIX system:

  • navigate to the directory specified by the -work system option
  • run a ls -l|grep username there, where username is the userid you use to log on to the workspace server.
  • you get one or more directories (starting with "SAS") listed that belong to you
  • within each directory, there's another one the name of which also starts with "SAS"; change to it, and copy the .sas7bdat files found there to a permanent library of your choosing.

Note that a regular run of the cleanwork utility will remove such orphaned directories, so you need to preserve your data before that happens; a regularly repeating execution of cleanwork has to be part of every decent SAS server setup.

View solution in original post

2 REPLIES 2
ballardw
Super User

There are some options you can set beforehand but it sounds like you may not have those.

If you interrupt a SAS session so that the system can't clean up the WORK library then the folder and data sets should be in the current temporary folder. So you could Kill SAS using you favorite tool for such, Task Manager will do that in Windows.

 

Then Start a new SAS session and assign a library reference to the previous WORK library location. Copy the data sets to the new work library.

I am not sure which files you mean by Util. The may be in the same folder as the old work library but moving them may be tad rougher depending on which ones.

 

And a learning point or two. You may want to identify key intermediate step data sets and create those in a permanent library.

Another option that might help is use of the special USER library as the target of single level names. The USER library is not cleaned up at the end of a SAS session so you have to clean it up. In  this environment you need to explicitly use the WORK libname to send data sets and such there. One nice thing about the USER library is you can turn it off (USER=WORK) and on with the OPTIONS statement.

Kurt_Bremser
Super User

"UTIL" files are not of interest. They are only created dynamically by a step and removed automatically once that step finishes. You can't reuse them in a new step. The only sensible thing you can do with them is to delete them to reclaim the disk space.

If you forcibly terminate the SAS process (kill -9 on a UNIX system), you prevent the automatic deletion of the WORK (and UTILLOC, if it is separate) directory.

I can only give you advice for finding your dead WORK on a UNIX system:

  • navigate to the directory specified by the -work system option
  • run a ls -l|grep username there, where username is the userid you use to log on to the workspace server.
  • you get one or more directories (starting with "SAS") listed that belong to you
  • within each directory, there's another one the name of which also starts with "SAS"; change to it, and copy the .sas7bdat files found there to a permanent library of your choosing.

Note that a regular run of the cleanwork utility will remove such orphaned directories, so you need to preserve your data before that happens; a regularly repeating execution of cleanwork has to be part of every decent SAS server setup.

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
  • 2 replies
  • 1300 views
  • 2 likes
  • 3 in conversation