PCHKACT checks whether a particular job - identified
only by the 6-digit job number - is active on your
System i (ISeries, AS/400, AS400) machine. You pass in
the parameter job number and PCHKACT returns a boolean
(Y/N) parameter indicating if that job number is active.
This is one of the commands in our ISeries
utilities library (click this URL for full
Prospero Software PSPUTIL contact and pricing details).
Normally when you check a particular ISeries job (e.g.
using the DSPJOB command), you need the three full job
identifiers Name/User/Number (10+10+6 characters). Some
applications use the job number only e.g. to record the
number of the job which is currently locking a
particular record or file. These applications typically
first post their own job number to lock out other jobs,
then blank this out later when they have finished. If
this second step fails, the lock is held indefinitely -
or until some control function checks whether that job
is actually still active. This check can be done by
PCHKACT.
There is no IBM-supplied ISeries command which works on
job number only. There are two ways to get job details
given only a job number. The first is to use WRKACTJOB
with OUTFILE output, which is *very* resource-intensive.
The second way - used by PCHKACT - is to use APIs, which
is much quicker.
A job is deemed 'active' if it is currently executing.
Jobs that are on a job queue (status *JOBQ) or that have
completed execution with spool files remaining (status
*OUTQ) are both deemed inactive.