MIAMEX 73: Read job control block

xcall MIAMEX, MX_READJCB, jobno, buffer {,lokflg}

XMX_READJDB reads a job control block or record from jobtbl.sys.

Parameters

jobno (Num)

the job number of the block to read. (This is equivalent to the record number, starting at 1 for the first job.) jobno 0 refers to the control record, which should not be accessed.

buffer

the record buffer to receive the data. It should be mapped per the JCB'REC map statement in JOBTBL.MAP in SOSLIB:[907,16].

The jcb’jobtyp field values are defined by the JOBTYP symbols in JOBTBL.DEF in SOSLIB:[907,16].

The jcb’jobsts field values are defined by the JCBSTS symbols in JOBTBL.DEF.

lokflg (Num)

may optionally be set to 1 to lock the record prior to reading it (leaving it locked thereafter). To unlock it you would then need to write the record back, using Function 74, and also specifying the same lokflg=1.

To scan all of the job table records, start at JOBNO=1 and keep incrementing it, skipping records with JCB'JOBTYP = JOBTYP'FREE, and quitting when you hit a record with JCB'JOBTYP = JOBTYP'EOF.