IBM Support

Creating a report of Job Scheduler Activity

Question & Answer


Question

How do you create a report of Job Scheduler Activity?

Answer

With the introduction of the IBM i SQL Service HISTORY_LOG_INFO table function, you can create an SQL report containing Job Scheduler messages from the history log.  
 

The HISTORY_LOG_INFO table function returns one row for each message in the history log based on the timestamp range specified. It returns information similar to what is returned by the Display Log (DSPLOG) CL command and the Open List of History Log Messages (QMHOLHST) API.

Authorization: No authorization needed.

To get a listing of selected messages from the history log, follow the steps:
Method 1: For releases R720 and above:
1) Open the ACS Run SQL Scripts tool 
2) Run the following SQL:
select MESSAGE_ID,
       MESSAGE_TIMESTAMP,
       FROM_USER,
       FROM_JOB,
       MESSAGE_TEXT,
       MESSAGE_SECOND_LEVEL_TEXT
    from table (
            QSYS2.HISTORY_LOG_INFO(current timestamp - 5 day)
        )
    where MESSAGE_ID in ('CPI1141',
            'CPI1142', 'CPI1143', 'CPI1144', 'CPI1145', 'CPI1146', 'CPC1236', 'CPC1242', 'CPC1243', 'CPC1119', 'CPC1120')
image-20220609090847-1
Note 1: Modify the number of days for the report. 
Note 2: For recovery actions on jobs that failed to run, review the second-level detail on the message.
Note 3: 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 > Connected > Edit JDBC Connection > Translation and click on Translate CCSID 65535. Save the connection and reconnect to run the SQL.
More information about the HISTORY_LOG_INFO table function can be found on the link:
 
Method 2: For Older releases of the Operating system:
Run the command:
DSPLOG PERIOD((HHMMSS MMDDYY) (HHMMSS MMDDYY)) OUTPUT(*PRTSECLVL) MSGID(CPI1141 CPI1142 CPI1143 CPI1144 CPI1145 CPI1146 CPC1236 CPC1242 CPC1243 CPC1119 CPC1120) 
image-20220805074519-1
Note 1:  Modify the date and time on the command. 

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CHjAAM","label":"Job and Work Management"}],"ARM Case Number":"TS009591501","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.2.0;7.3.0;7.5.0"}]

Document Information

Modified date:
05 August 2022

UID

ibm16593845