Skip to content

sas-data-mon

sas-data-mon is a small utility that recursively scans the directories specified to find important, unused and duplicate data stored within a SAS environment. For every file that it finds, the following information is captured:

  • Folder name
  • File name
  • Owner
  • File size (in bytes)
  • Last accessed time
  • Last modified time
  • Node Name*

* This is the name of the server on which the program was executed. If the --esm-home option is specified, the value used here is the value of ESMNODENAME, alternatively the hostname of the machine is used. This value can be obfuscated by using the --node-mapping-file option. See below for more details on these options.

Installation

Once downloaded, extract the ZIP file to a directory of your choosing.

Usage

  1. Change directory to the location of the extracted ZIP. There should be two files in the directory: sas-data-mon (sas-data-mon.exe on Windows) and settings.yaml.
  2. Using your favorite text editor, modify settings.yaml to update:
    1. The paths in the directories list that you wish to scan. The application will scan these paths iteratively and recursively.
    2. The paths in the unwantedDirectories list are those that you do not wish to scan. The application ignores these directories and all of their sub-directories. You must specify the full path the folders that you wish to exclude
    3. The extensions of the files that you are not interested in capturing in the unwantedExtensions
    4. The file names (including their extensions) that you are not interested in including within the output files
  3. Execute the script: ./sas-data-mon (.\sas-data-mon.exe from the command prompt on Windows)

After the script completes a CSV file called sas-data-sets.csv will be created in the current folder.

Command Line Arguments

Option Description Default Value
--esm-home or -e The location of your SAS Enterprise Session Monitor Agent installation. None
--node-mapping-file or -n The full path to the 'DONOTSEND_node_hash_mapping.csv' file. None
--file-name or -f The name of the output data file. sas-data-sets.csv
--user-mapping-file or -u The full path to the 'DONOTSEND_user_hash_mapping.csv' file. None

Configuration Reference

Option Description Default Value
directories A new-line separated list of all of the directories that are to be recursively scanned.
unwatedDirectories A new-line separated list of all of the directories, and their sub-directories, that should not be scanned. You must specify the full path the folders that you wish to exclude
unwantedExtensions A new-line separated list of the extensions that should be ignored.
unwantedFiles A new-line separated list of file names (including their extensions) that should be ignored.
wantedExtensions A new-line separated list of the extensions that should be captured. If this property is specified in the settings.yaml only the extensions listed will be captured.
logLevel INFO
fileEncoding utf-8
ignoreUserLookupWarnings False

Many of the options above reference a "new-line separated list". In the YAML configuration file for this utility these lists look something like the below:

unwantedExtensions:
  - .sas7bdat
  - .csv
  - ...

Support

For support using this tool, please contact SAS Technical Support.


Last update: July 18, 2023
Created: April 24, 2023