Here is a Monday morning classic: a batch job that should have run over the weekend did not, and now you are trying to figure out why. Half the time, the answer is that it is still sitting on a job queue, held or waiting, and nobody noticed.
You do not have to go poking through WRKACTJOB and job queue screens one at a time. Ask the system directly:
SELECT JOB_NAME, JOB_STATUS,
JOB_QUEUE_LIBRARY, JOB_QUEUE_NAME,
JOB_QUEUE_STATUS, JOB_ENTERED_SYSTEM_TIME
FROM TABLE(QSYS2.JOB_INFO(
JOB_STATUS_FILTER => '*JOBQ',
JOB_USER_FILTER => '*ALL'))
ORDER BY JOB_ENTERED_SYSTEM_TIME;
That lists every job currently sitting on a job queue, which queue it is on, and whether it is released or held. The JOB_QUEUE_STATUS column solves your Monday mystery: a job in HELD status goes nowhere until someone releases it, and JOB_ENTERED_SYSTEM_TIME tells you how long it’s been stuck there.
I love JOB_INFO because it puts the whole job world in one queryable place. Change that filter to *ACTIVE and you see running jobs. Change it to *OUTQ and you see completed ones. You can filter by user, by subsystem, by job queue. It turns “let me go check a few screens” into “let me ask one question and get the answer.”
The specific win for a Monday: run this first thing, sorted by entered time, and any critical batch work that got stuck over the weekend is right there at the top of your list before the phone rings. That is the difference between finding a problem and having a problem find you.
Run it Monday morning. It is a thirty-second habit that will save you more than one bad start to the week.
#IBMi #Power
Originally posted on LinkedIn. Join the conversation there.
Leave a Reply