Running SQL query for ENF event data. Where is the info on the actual USER causing the event?

Document ID : KB000049411
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

In the previous version of ENF (ie. r1.0), before Datacom/AD was used for the database, the CAS9DB QUERY utility was used to obtain information relating to a specific event. One useful piece of information was USER. Where USER was the user belonging to the JOBNAME causing the event.

Starting with ENF r12, when Datacom/AD started to be utilized as the database of choice, running an SQL job (PGM=DBSQLPR) with USER as one of the SELECT criteria, the user belonging to the JOBNAME is not returned. Instead the ENF AUTHID CAS9ENFS is returned.

Example:

//SQL EXEC PGM=DBSQLPR,REGION=0M,PARM='AUTHID=CAS9ENFS'
SELECT DSN,DATE,TIME,JOBNAME,USER
FROM CAS9ENFS.DSCLOSE;

Solution:

When coding the SELECT statement enclose USER in double quotes as follows:

//SQL EXEC PGM=DBSQLPR,REGION=0M,PARM='AUTHID=CAS9ENFS'
SELECT DSN,DATE,TIME,JOBNAME,"USER"
FROM CAS9ENFS.DSCLOSE;