Your SAS programs, embedded in web apps and elsewhere

Way to prevent SAS Stored Process from killing the contents of WORK library?

Reply
Occasional Contributor
Posts: 6

Way to prevent SAS Stored Process from killing the contents of WORK library?

Hello,

I have a stored process that creates a number of datasets in the WORK library.  I would like the user to be able to navigate through WORK to see the results of each step of the program.  Once they close the SAS session, the WORK directory will be cleared as it normally does.  My problem is that the SAS Stored Process appears to be killing the contents of WORK before the user even has a chance to look at it.  Is there a way to prevent SAS from killing the WORK library contents?

Thanks!

Regular Contributor
Regular Contributor
Posts: 166

Re: Way to prevent SAS Stored Process from killing the contents of WORK library?

Hi.. why not divert the results to a permanent library .. Any restrictions ?

Also have a look at creating sessions in stored process... they will be useful for your requirement

Occasional Contributor
Posts: 6

Re: Way to prevent SAS Stored Process from killing the contents of WORK library?

Hi NN,

Thanks for the response.

I don't want to write to a permanent library because the intermediate datasets are very large (i.e. combined they amount to about 500GB).  While I want the user to be able to view the intermediate files, I don't want these files to remain on the server taking up space after they close the session.

I will look in Stored Process Sessions as you suggested -- perhaps I'm just going about this the wrong way entirely.

Thanks!

Regular Contributor
Regular Contributor
Posts: 166

Re: Way to prevent SAS Stored Process from killing the contents of WORK library?

Well I think you can also consider transient package for results.. but i do doubt the impact that the size of your overall results will have on your application.

Super User
Posts: 5,516

Re: Way to prevent SAS Stored Process from killing the contents of WORK library?

Here are a few ideas.  None of them is exactly what you asked for, but some of them may form part of a workaround.

Sometimes, file systems contain disk pools that get erased overnight.  If you have such a system, you could use that for the WORK libraries.

To save WORK data sets permanently, you don't need to change much.  The USER= global option directs the storage location for one-level SAS data set names, and can be set to any defined libname.  (The default is USER=WORK.)

Perhaps you could modify the EG steps to output 1,000 observations from each WORK data set to a permanent data set with a matching name.

Perhaps you could add a PROC DATASETS to the workflow, either at the beginning or at the end, to wipe out a permanent library.

Good luck.

Contributor RSB
Contributor
Posts: 72

Re: Way to prevent SAS Stored Process from killing the contents of WORK library?

You may consider asking the users to Copy the stored process code and execute it in a  SAS Program in the Enterprise Guide instead of executing the Stored Process to review the Temporary tables. Any Prompts defined in the Stored process can be handled by the %let statement in the code.

Occasional Contributor
Posts: 6

Re: Way to prevent SAS Stored Process from killing the contents of WORK library?

Thank you for all of the great suggestions!

I think my best option is to write the datasets to a permanent scratch drive that would be cleared at the end of every day.  I will have to contact IT to set up such a drive.

Ask a Question
Discussion stats
  • 6 replies
  • 606 views
  • 6 likes
  • 4 in conversation