The NATRJE utility (Natural Remote Job Entry) can be used to submit JCL cards from a Natural program to the operating system for scheduling and execution. For example, it is possible to start a Natural batch job with NATRJE.
The NATRJE Utility - Natural Remote Job Entry documentation covers the following topics:
NREXPG - User Exit for NATRJE in the Operations documentation
The following graphic is a simplified functional diagram of the NATRJE utility:
The Natural program calls the NATRJE utility for the purpose of submitting JCL cards to be executed by the operating system. | |
NATRJE collects the JCL cards into the RJE buffer until the Natural program
indicates that the job is complete. The RJE buffer holds the JCL cards before
they are submitted. The initial size of the RJE buffer is determined by the
RJESIZE
profile parameter (as described in the Parameter Reference
documentation). If a given job does not fit into the RJE buffer, the buffer is
automatically enlarged. The maximum size of a job is determined by the thread or
region size.
|
|
NATRJE transfers the JCL cards to the operating system internal job queue for scheduling and execution by the operating system. |
This section covers the following topics:
To invoke the NATRJE utility
In the Natural program that invokes the NATRJE utility, specify a
CALL
statement by using the following syntax:
CALL 'NATRJE' parm1 parm2 parm3
parm4 |
The parameters specified in the CALL
statement are explained in the
following table:
Parameter | Explanation | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parm1
|
The starting JCL card of the table which contains one or more 80-character JCL cards to be submitted. | ||||||||||||||||||||
parm2
|
A 4-byte binary field which contains the number of 80-character JCL cards to be submitted. | ||||||||||||||||||||
parm3 |
|
||||||||||||||||||||
parm4
|
A 2-byte binary field in which NATRJE returns a response code. |
This section provides Natural example programs that submit JCL cards:
The following is a Natural example program that submits, in one call to NATRJE, a three-card JCL stream.
DEFINE DATA LOCAL 01 COUNT (B4) 01 FLAG (A1) 01 RETHEX (B2 01 CARDS (A240 01 REDEFINE CARDS 02 CARD1 (A80) 02 CARD2 (A80) 02 CARD3 (A80) END-DEFINE MOVE '//JOBN JOB CLASS=G,MSGCLASS=X' TO CARD1 MOVE '//XXX EXEC PGM=IEFBR14' TO CARD2 MOVE '//DD1 DD DSN=NATRJE.SOURCE,DISP=SHR' TO CARD3 MOVE 3 TO COUNT MOVE 'L' TO FLAG CALL 'NATRJE' CARDS COUNT FLAG RETHEX IF RETHEX = H'0000' WRITE 'JOB submitted successfully' ELSE WRITE 'ERROR from NATRJE' RETHEX END-IF END
A Natural program that issues a CALL
statement to NATRJE results in one of
the following return codes being returned in the fourth parameter of the statement. There
are return codes that apply to all environments and additional codes that are dependent on
the operating system:
Return Code/Hexadecimal | Return Code/Decimal | Explanation |
---|---|---|
00 | 00 | Normal return. |
04 | 04 | NATRJE utility not available. |
08 | 08 | NATRJE utility disabled; a possible reason is that the RJESIZE profile
parameter is set to 0 (see also the Parameter
Reference documentation).
|
0C | 12 | Invalid number of JCL cards. |
10 | 16 | Invalid function code. |
14 | 20 | No RJE buffer space available. |
18 | 24 | Invalid number of parameters. |
1C | 28 | I/O error during submit. |
20 | 32 | Job flushed by user exit NREXPG (see NREXPG - User Exit for NATRJE in the Operations documentation). |
Return Code | Explanation |
---|---|
01nn | CICS WRITEQ TD failure; nn is the CICS response code in hexadecimal format. |
01nn | CICS CLOSE TD failure; nn is the CICS response code in hexadecimal format. |