Question & Answer
Question
How do you find out what active jobs are using a Job Description?
Answer
Using the ACTIVE_JOB_INFO table function you can create a report of active jobs and their associated Job Descriptions.
Authorization:
-
None required to see general information or to see information for jobs where the caller's user profile is the same as the job user identity of the job for which the information is being returned.
For DETAILED_INFO => ALL:- All callers can see detailed column information for CLIENT_IP_ADDRESS, PAGE_FAULTS, JOB_ACTIVE_TIME, PRESTART_JOB_REUSE_COUNT, PRESTART_JOB_MAX_USE_COUNT, and WORKLOAD_GROUP.
- A caller with QIBM_DB_SQLADM or QIBM_DB_SYSMON function usage authority can see detailed column information that relates to SQL activity starting with the SQL_STATEMENT_TEXT column through the PSEUDO_CLOSED_CURSOR_COUNT column.
- A caller with *JOBCTL user special authority can see all detailed column information.
Using the RUN SQL Scripts tool, run the following SQL Statement:
select substr(JOB_NAME, 1, 6) as JOB_NUMBER,
substr(JOB_NAME, 8, posstr(substr(JOB_NAME, 8), '/') - 1) as JOB_USER,
substr(substr(JOB_NAME, 8), posstr(substr(JOB_NAME, 8), '/') + 1) as JOB_NAME,
JOB_DESCRIPTION,
SUBSYSTEM,
SUBSYSTEM_LIBRARY_NAME,
JOB_QUEUE,
OUTPUT_QUEUE,
JOB_STATUS
from table (
QSYS2.ACTIVE_JOB_INFO(DETAILED_INFO => 'ALL')
)
where JOB_DESCRIPTION = 'QDFTJOBD'

NOTE: The SQL lists all active jobs that are using the QDFTJOBD job description.
NOTE 2 : JOB_QUEUE contains the null value if the job is not a batch job that was started from a job queue.
NOTE 3: OUTPUT_QUEUE contains the null value if the job is not a batch job that was started from a job queue.
ACTIVE_JOB_INFO table function
https://www.ibm.com/docs/en/i/7.4?topic=services-active-job-info-table-function
[{"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":"a8m0z0000000CHAAA2","label":"Operating System"}],"ARM Case Number":"TS006856715","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.2.0;7.3.0;7.4.0"}]
Was this topic helpful?
Document Information
Modified date:
15 September 2021
UID
ibm16489487