Overview
The SAS Web Report Studio Key User Action Log records events such as application use, failed attempts to log on, report access, and batch report activities. This sample explains how to create a report that shows how often specific reports are opened and saved.
Note: For a complete list of events included in the log, see Understand Key User Action Log Output.
Create a SAS Data Set from the Key User Action Log file
- By default, the Key User Action Log files are created on a daily basis, so additional steps might be necessary to report over a period of time. The code below creates the table that is used as input to the information map. You can submit the code in an interactive Base® SAS session or in a SAS® Enterprise Guide® program node.
/*
***************************************************************************************************
* Add the closing tag "</wrskeyuseractions>" to the Key User Action log.
* This can be done manually or by running the code below. Modify the paths for your file.
****************************************************************************************************
*/
data _null_;
infile 'C:\SAS\EBIserver\Lev1\Web\Logs\SASWebReportStudio4.4_KeyActions.log' lrecl=10000 end=_last;
file 'C:\SAS\EBIserver\Lev1\Web\Logs\SASWebReportStudio4.4_KeyActions.xml' lrecl=10000;
input;
put _infile_;
if _last then do;
put "</wrskeyuseractions>";
end;
run;
/* Location of the Key User Action Log. Modify to point to the file you created above. */
LIBNAME myxml xml "C:\SAS\EBIserver\Lev1\Web\Logs\SASWebReportStudio4.4_KeyActions.xml";
/*
*******************************************************************************
* Library that will store the SAS data set. This library must be
* registered in SAS Management Console. Edit the statement for your library.
* ********************************************************************************
*/
LIBNAME Orion BASE "C:\Orion\data";
/* Add a count variable to make it easy to sum up rows */
data Orion.WRSevents;
set myxml.event;
count=1;
run;
- After you create the WRSevents table, use the Data Library Manager plug-in to SAS® Management Console to register it in metadata
Create the Information Map
In SAS® Information Map Studio, insert the WRSevents table as a data source and select all of the data items. Save the information map, making note of its location.
Create the Report
- In SAS Web Report Studio, select the information map that you just created based on the WRSevents table, and select all of the data items.
- In the layout grid, insert a crosstabulation table. Make the following assignments for the columns and rows.
- Columns: Description, Code, Count
- Rows: Report
- Create a filter to select codes 3 and 4. Code 3 is the save event, and code 4 is the open event.
View the Report
Click View to display the report. The following is an example of what the report might look like:

Available User Action Codes
The following table lists all of the codes that you can use in your report:
Event | Code |
User logged on | 0 |
User attempted to log on but failed | 1 |
User logged off | 2 |
User saved a report | 3 |
User opened a report | 4 |
User deleted a report | 5 |
User moved a report | 6 |
User copied a report | 7 |
User renamed a report | 8 |
System start | 9 |
User scheduled a report. If the user scheduled a folder of reports, then the log file lists the folder | 10 |
User distributed a scheduled report | 11 |
User created, edited, or deleted a distribution list | 12 |
Additional Documentation
For more information about SAS Web Report Studio, see the SAS Web Report Studio documentation page.
For more information about SAS Information Map Studio, see the SAS Information Map Studio documentation page.
For more information about SAS Management Console, see the SAS Management Console documentation page.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.