About Audit Messages for SAS Library Access

The logging facility provides a logger, Audit.Data.Dataset.Open, to audit access to any SAS library, including database tables that have been assigned by a LIBNAME statement. You can obtain the following information about a SAS library:
  • the libref
  • the engine associated with the library
  • the library member name
  • the library member type, such as catalog or data set
  • the mode that the library was opened for: INPUT, OUTPUT, UPDATE
  • the path to the library or to a database table
    Note: Audit messages are not available for in-database tables, filerefs, or SAS cubes.
Based on the XML configuration files that SAS provides, auditing messages appear when the logging threshold is TRACE.
To configure the XML configuration file for auditing SAS libraries, you specify a path and filename for the audit log in the appender fileNamePattern parameter. Then, specify a conversion pattern in the conversionPattern parameter.
Here is an example audit path and filename:
In the appender conversionPattern parameter, you specify the type of information that you want the message to contain using the %E conversion character. The following table lists the conversion character syntax for the information that you can obtain about a SAS library:
Information Type
Conversion Pattern
member name
member type
open mode
Here is a sample conversion pattern:
DateTime=%d Userid=%u Libref=%E{Audit.Dataset.Libref} 
Engine=%E{Audit.Dataset.Engine} Member=%E{Audit.Dataset.Member} 
MemberType=%E{Audit.Dataset.Memtype} OpenMode=%E{Audit.Dataset.Openmode} 
Here is a message from the audit log:
Userid=user1@deptProg, Libref=MULTI, Engine=V9, Member=myTestData, 
MemberType=DATA, OpenMode=INPUT, Path=c:\temp
For a sample logger and appender, see Sample: XML Logger and Appender.