Obtaining a job identifier

If you want to obtain the job identifier for a job, you must use an ENDREQ macro. see z/OS DFSMS Macro Instructions for Data Sets.

Issue an ENDREQ macro after writing a complete job to the internal reader. The job identifier is returned in the RPLRBAR field of the request parameter list (RPL). See z/OS JES2 Commands or z/OS JES3 Commands for details about the job identifier.

RPLRBAR is an 8-byte field. The first 3 bytes, xxx, are the characters JOB, TSU or STC. The remaining 5 bytes, nnnnn, represent the five digits of the job number. See z/OS JES2 Initialization and Tuning Guide or z/OS JES3 Initialization and Tuning Guide for more information.

If you submit JCL, and JES does not recognize it as a job, RPLRBAR contains blanks or a job id from an earlier job submitted through the internal reader.

Note that the RPL cannot have records longer than 80 bytes. Specify the following options on the RPL macro when creating an RPL:
  OPTCD=(ADR,SEQ,SYN,NUP),RECLEN=80
Where:
ADR
Specifies addressed data processing with no index references.
SEQ
Specifies sequential processing.
SYN
Specifies a synchronous request and that control should be returned after completion of the request.
NUP
Specifies non-update mode (records retrieved are not updated or deleted).
RECLEN=80
Specifies that the submitted JCL records are 80 bytes.

Note that you must issue a CLOSE macro after the last ENDREQ.

The format of job numbers being displayed as part of command responses or messages can change depending on whether JES2 is set up to support greater than 65K jobs. When job numbers are potentially greater than 99,999, the format for job numbers is as follows: if the maximum allowed job number (high value of the JOBDEF RANGE= statement) is above 99,999, the job number format is J0nnnnnn. This format is used unless the job number range is decreased below 100,000. Similarly, STCnnnnn becomes S0nnnnnn and TSUnnnnn becomes T0nnnnnn.

Note: If you use the PUT macro with the ACB interface to send the job output to the internal reader, allocate the RPL below the 16 MB line or a system abend X'36F' might occur in certain environments, such as JES3 levels earlier than z/OS V1R13 (HJS7780). Starting with z/OS V1R13, JES3 supports allocating the RPL above the line.