SAS Server - Delete SAS Datasets?

Posts: 40

SAS Server - Delete SAS Datasets?

Our company is relatively new to SAS.  We are quickly realizing that our server is filling up with all the SAS datasets that we are creating.  (For example, we have 1.3 TB of SAS datasets for one of our users.)  Would periodically deleting these datasets from the server cause a problem when the user goes back into the project?  We can just rerun the project and recreate the datasets, correct?  Thank you.

Super User
Posts: 5,884

Re: SAS Server - Delete SAS Datasets?

Well, that depends on the logic within each project.

As a rule of thumb, if the source data is still there, the target data could be re-recreated.

But to be sure, check the logic in each project...

Data never sleeps
Super Contributor
Posts: 644

Re: SAS Server - Delete SAS Datasets?

I would advise a little investigation.  Normally a SAS project can store data in several different kinds of libraries (folders or collections of folders)

  1. Work files, considered temporary, which should be deleted automatically at the end of each session
  2. Assigned locations, which can be anywhere the user has access, and would be considered 'permanent' by the SAS session
  3. Each users SASUSER folder, which are also considered permanent but private to the user
  4. Each session's copy of the SASHELP library which contains sample data, map data and temporary metadata used in the SQL procedure.  This copy should not persist.

Check the work files first:  they are in folders named something like,  _TDnnnn (TD = temporary directory).  Any folders more than a week or so old should be investigated.  Users can leave a session open for days but this is not good practice.  SAS provides a script to clean up old folders (left behind when a session is terminated abnormally) next time the user starts a session.

Check the SASUSER folders next.  Traditionally this was not used much but some Enterprise Guide projects rely on temporary files used in queries being present the next time the project runs.  If you delete these files the projects will fail next time they run.  If this is a problem you should encourage users to run SQL with "delete from table X" for each such table.  This will leave the table structure in place but with no data.

Check the permanent folders next.  Some users might be over cautious saving intermediate tables when they should go into the WORK directory.  Analysis by user should identify the guilty, who should be requested to hoard less.

I would not advocate deleting files from the SASHELP folders, unless you have reason to believe the hoarders have shifted data in there to escape detection.


Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation