![]() | ![]() | ![]() |
The SAS® restricted option facility allows an administrator to designate a set of options that can be set only during SAS initialization. Restricting options during initialization prevents a SAS user from modifying the option value within the instances of the SAS session. In environments where audit requirements dictate tracking of SAS Sessions, the Base SAS feature Application Response Measurement (ARM) can be used to meet those audit requirements.
Using a combination of the restricted option facility and the ARM feature allows an administrator to create logs for each SAS session, including distributed environments with SAS® Enterprise Guide, SAS® Enterprise Miner, or SAS® Data Integration Studio clients. The ARM records generated by the SAS session include the date and time of the SAS session, userid, elapsed time, and processor utilization information. Additionally, through the use of the ARMSUBSYS option, the ARM log will contain the SAS procedures and data sets that were utilized within the SAS session.
The following technique creates dynamic ARM logs using the ARMLOC option along with the SAS restricted option facility. An administrator could then further tailor the options and reporting to meet local site installation requirements. The basic steps include creating a UNIX script to dynamically generate a restricted option file, modifying the sas.sh file to launch the script, and using the Base SAS macro ARMPROC facility to analyze the reports from the generated ARMLOC log files:
For example, assume the following script is created in the SAS data directory, /data/SAS/ARM/script/arm_user_script.sh:
#!/bin/sh
user=$USER
arm_datetime=`date +%d_%m_%Y_%T`
echo "-ARMSUBSYS=(ARM_DSIO VARINFO WHERETXT) -armloc /data/SAS/ARM/logs/${USER}_${arm_datetime}.log" >/data/SAS/software/SAS_9.1/misc/rstropts/users/${user}_rsasv9.cfg
#!/bin/sh
# This script invokes SAS with the default configuration for this
# application server. It changes directories so that SAS is invoked
# from the root directory of this application server.
# Variables Used:
# $USER_MAGIC_FOLDER_2$ = /data/SAS/config/Lev1/SASMain
# $SASROOT$ = /data/SAS/software/SAS_9.1/
Quoteme() {
if [ $# -gt 1 ]; then
quoteme="\"$*\""
else
quoteme=$1
fi
}
# Call the arm_user_script.sh
/data/SAS/ARM/script/arm_user_script.sh
cd /data/SAS/config/Lev1/SASMain
cmd="/data/SAS/software/SAS_9.1//sas"
…
…
data a; a=1; run; options armloc="/dev/null"; 4 options armloc="/dev/null"; ------ WARNING 36-12: SAS option ARMLOC is restricted by your Site Administrator and cannot be updated.
The following restricted option file is generated:
$ pwd /data/SAS/ARM/logs $ ls -ltr total 3 -rwxr-xr-x 1 sasdev sas 442 Mar 13 09:47 sasdev_13_03_2009_09:46:47.log
Here are the contents of the ARM log:
$ more sasdev_13_03_2009_09:46:47.log I,1552556807.159289,1,0.0,0.10000,SAS,sasdev G,1552556807.159316,1,1,MVA_DSIO.OPEN_CLOSE,DATA SET OPEN/CLOSE,LIBNAME,ShortStr,MEMTYPE,ShortStr,MEMNAME,LongStr S,1552556817.227286,1,1,1,0.20000,0.30000,WORK ,DATA ,A U,1552556817.227396,1,1,1,0.20000,0.30000,2,VAR(1,a),DEF P,1552556817.228627,1,1,1,0.20000,0.30000,0,WORK ,DATA ,A E,1552556836.678706,1,0.20000,0.30000
Note that the contents include the effective userid in line 1 (sasdev), the DATA step (DATA), the SAS data library (A), and any variables defined (a).
| Product Family | Product | System | SAS Release | |
| Reported | Fixed* | |||
| SAS System | Base SAS | 64-bit Enabled AIX | 9.1 TS1M3 | |
| 64-bit Enabled HP-UX | 9.1 TS1M3 | |||
| 64-bit Enabled Solaris | 9.1 TS1M3 | |||
| HP-UX IPF | 9.1 TS1M3 | |||
| Linux | 9.1 TS1M3 | |||
| OpenVMS Alpha | 9.1 TS1M3 | |||
| Tru64 UNIX | 9.1 TS1M3 | |||
| Type: | Usage Note |
| Priority: |
| Date Modified: | 2009-05-15 13:17:35 |
| Date Created: | 2009-03-17 14:29:00 |


