A system variable that returns the JES2/3 job number for the last job submitted by NCL (OS/VS only).
NCL supports the output of records directly to the JES2/3 system spool. This is achieved using the standard file processing facilities of NCL. Direct submission to the system internal reader is also supported. In such cases an &FILE GET OPT=END statement is used to signal the end of a job stream and the &ZJOBNUM system variable will then be set to the job number allocated by JES to that job. This value remains intact until another job is submitted or the procedure terminates.
&ZJOBNUM will return a 1- to 5-character job number. If no jobs have been submitted, a null value is returned.
&ZJOBNUM is set only if the JES internal reader has been dynamically allocated using the ALLOCATE command. See notes below.
Example: &ZJOBNUM
&FILE OPEN ID=MYJES FORMAT=UNMAPPED
-* Request unmapped mode.
&FILE PUT ID=MYJES VARS=CARD
-* Put to internal reader.
&FILE GET ID=MYJES OPT=END
-* Signal end of JCL stream.
&WRITE DATA=THE JOB NUMBER IS &ZJOBNUM.
-* Display submitted job no.
&FILE CLOSE ID=MYJES-* Free resources.
Notes:
The use of &FILE GET OPT=END in such cases merely signals to NCL that the VSAM RPL is no longer required for processing. NCL in turn issues a VSAM ENDREQ request, which signals to JES the completion of the submission. JES then returns the number of the last job submitted.
Dynamic allocation of the internal reader is performed using the ALLOCATE command with the SYSOUT and PGM operands. For example:
ALLOC SYSOUT=A PGM=INTRDR DD=MYJES ID=*
| Copyright © 2009 CA. All rights reserved. |
|