SAS administrators often ask for a utility that can detect orphaned SAS WORK and SAS Utility directories on their back-end SAS compute systems. These orphaned directories result when a SAS Enterprise Guide or any other SAS GUI application is terminated incorrectly, and the SAS session does not terminate properly.
SAS has written utilities to detect these directories and delete them.
For UNIX/Linux, you use the cleanwork utility in the !SASHOME/bin/utilities directory that has been shipping with SAS since SAS 8.2. The utility deletes any leftover SAS WORK and SAS Utility directories that were associated with a SAS process that has ended. For more details, please refer to the cleanwork command documentation in the SAS 9.4 Companion for UNIX Environments.
For Windows, SAS has recently been promoting the SAS Disk Cleanup Handler Utility. This utility searches for and cleans any temporary files that SAS generates, as well as any SAS WORK and SAS Utility directories. SAS Disk Cleanup Handler is a COM hook into the Microsoft Disk Cleanup Handler (cleanmgr.exe). For more details, please refer to the SAS Disk Cleanup Handler Utility documentation in the SAS 9.3 Companion for Windows. Please note that this version of the utility is available with SAS 9.2 and SAS 9.3.
Starting with SAS 9.4M2, there is a new stand-alone utility – cleanwork.exe – that you can use with any version of SAS, starting with SAS 6.
We have placed this utility along with its documentation on the SAS FTP download page:
- Cleanwork utility for Windows 32-bit
- Cleanwork utility for Windows 64-bit
- The SAS Cleanwork Utility for Windows documentation
Many of our SAS administrators who are using these utilities have them scheduled to run once a week or once a month, depending on the frequency of their SAS users incorrectly terminating SAS sessions or the amount of free space they have in the SAS WORK and SAS Utility file systems.