How To
Summary
How to create a report of JOBQ operations when auditing the JOBQ Object.
Objective
By turning on Object Auditing on the Job Queue object, we can track operations performed to the JOBQ.
Environment
Using the SQL DISPLAY_JOURNAL table function you can create a report for JOBQ operations.
Authorization:
- You must have *USE authority to the journal and to all requested journal receivers.
- *OBJEXIST authority is required to the journal if object-name is omitted or if object-name specifies an object that no longer exists.
- If object-name is *ALL, you must be authorized to every object associated with a journal entry.
Steps
Before you start, verify that the QAUDJRN exist and that you are tracking of object usage/change operations.
Use the DSPSECAUD command and make sure the following settings are configured on your system:
Security journal QAUDJRN exists . . . . . : YES
Current QAUDCTL system value . . . . . . : *OBJAUD
If not there, use the CHGSECAUD command to add them to your system.
Step 1. Turn on object auditing on the Job Queue object:
CHGOBJAUD OBJ(V6CASTIL/V6JOBQ) OBJTYPE(*JOBQ) OBJAUD(*CHANGE)
NOTE: Where V6JOBQ is the name of the Job Queue and V6CASTIL is the name of the Library.
Step 2 Using the SQL DISPLAY_JOURNAL table function you can create a report for operations on the JOBQ.
Using the RUN SQL Scripts tool, run the following SQL Statement:
SELECT entry_timestamp AS when,
"CURRENT_USER" AS user_name,
job_name,
job_user,
job_number,
INTERPRET(SUBSTR(entry_data, 12, 10) AS CHAR(10)) AS jobq_lib,
INTERPRET(SUBSTR(entry_data, 2, 10) AS CHAR(10)) AS jobq_name,
INTERPRET(SUBSTR(entry_data, 22, 8) AS CHAR(8)) AS object_type,
CASE INTERPRET(SUBSTR(entry_data, 30, 3) AS DECIMAL(5, 0))
WHEN 1 THEN 'ADD TO JOB QUEUE'
WHEN 7 THEN 'CHANGE JOB QUEUE'
WHEN 10 THEN 'CLEAR JOB QUEUE'
WHEN 17 THEN 'DELETE FROM JOB QUEUE'
WHEN 24 THEN 'HOLD JOB QUEUE'
WHEN 37 THEN 'RELEASE JOB QUEUE'
ELSE CHAR(INTERPRET(SUBSTR(entry_data, 30, 3) AS DECIMAL(5, 0)))
END AS access_type
FROM TABLE (
qsys2.display_journal(
'QSYS',
'QAUDJRN',
STARTING_RECEIVER_NAME => '*CURCHAIN',
journal_entry_types => 'ZC', object_objtype => '*JOBQ', starting_timestamp => '2024-04-02 06:00:00',
ENDING_TIMESTAMP => '2024-04-03 08:39:00') -- Specify the time frame for the report
)
ORDER BY access_type;

Note 1: Modify the time and date on the SQL.
Note 2: If Hexadecimal data is displayed on the report, you need to change the JDBC connection properties to translate the CCSID to 65535. On the Run SQL tool, select the Connection Menu > JDBC Connection > Edit > Translation and click on Translate CCSID 65535. Save the connection and reconnect to run the SQL.
To create a report of JOBQ activity auditing the Job Queue Commands, refer to the following link: Auditing the use of Job Queue Commands.
Document Location
Worldwide
[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CHyAAM","label":"Security"}],"ARM Case Number":"TS015509236","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.2.0;7.3.0;7.4.0;7.5.0"}]
Was this topic helpful?
Document Information
Modified date:
02 April 2024
UID
ibm17145708