Cleanwork

Searches and cleans temporary SAS files.

CAUTION:
Any <module name>.PID.DATE.log files in the AppData\Roaming\SAS\LOGS directory that a user wants to save should be relocated to another directory.
CAUTION:
Cleanwork searches and deletes _TD#### directories. The user should verify that no third-party applications use the same template for directories before running the cleanwork utility.

Syntax

cleanwork [/userlog] | [/alllogs] [/v volume(s)] [/d dir(s)] [/list] [/verbose]

Arguments

/userlog

Cleans SAS log files in current users AppData\Roaming\SAS\LOGS directory.

/alllogs

Cleans all users AppData\Roaming\SAS\LOGS directories.

CAUTION:
This option requires administrator privileges.

/v volume

specifies the volume to search for removal of SAS directories

Note: When specifying more than one volume separate them with spaces.

/d dir(s)

Cleans all SAS directories in the specified directory(s) where dir(s) are Windows or UNC paths to one or more directories.

Note: Paths need to be separated by a space (for example, /d path1 path2...).

/list

Lists files to be deleted. This option does not delete files or folders.

/verbose

Shows a trace of the program's activity.

Examples

Example 1

cleanwork /d c:\Temp
Cleans all SAS Work and Utility directories located in the c:\Temp directory hierarchy.

Example 2

cleanwork /d c:\Temp /userlog
Cleans all SAS Work and Utility directories located in the c:\Temp directory hierarchy and all log files in the \AppData\Roaming\SAS\LOGS directory.

Example 3

cleanwork /v c: u:
Cleans all SAS Work and Utility directories located on the c: and u: volumes.

Example 4

cleanwork /alllogs
Scans all users for a SAS\LOGS directory and cleans all log files found. This option will require administrator privileges to remove other users’ files.

Example 5

cleanwork /d c:\Temp /list
List all SAS Work and Utility directories located in the c:\Temp directory hierarchy to be deleted.

Example 6

cleanwork /v c: >cleanwork.log
Cleans all SAS Work and Utility directories located on the c: volume and dumps the output to the file cleanwork.log instead of printing it out to the screen.
Note: Do not use this utility with Windows task scheduler. Instead, write a script that includes the command and set the task scheduler to execute the script.