ᑍ
ᑍ Two Parameters are being passed into this program.
ᑍ
1 JOBD PIC X(1).
1 JOBDL PIC X(1).
ᑍ
PROCEDURE DIVISION USING JOBD, JOBDL.
MAIN-LINE.
ᑍ
ᑍ Beginning of Mainline
ᑍ
ᑍ Move the two parameters passed into JOB-DESC and JOB-DESC-LIB.
ᑍ
MOVE JOBD TO JOB-DESC.
MOVE JOBDL TO JOB-DESC-LIB.
ᑍ
ᑍ Error Code Parameter is set to 16.
ᑍ
MOVE 16 TO BYTES-PROVIDED.
ᑍ
ᑍ Receiver Length Set to 39.
ᑍ
MOVE 39 TO RECEIVER-LENGTH.
ᑍ
ᑍ Call the QWDRJOBD API.
ᑍ
CALL QWDRJOBD USING QWD-JOBD1, RECEIVER-LENGTH,
FORMAT-NAME, JOBD-AND-LIB-NAME, QUS-EC.
ᑍ
ᑍ If no bytes available, API was successful; print HOLD value
ᑍ
IF BYTES-AVAILABLE OF QUS-EC = PERFORM GOOD.
ᑍ
ᑍ If some bytes available, API failed; print Error message ID
ᑍ
IF BYTES-AVAILABLE OF QUS-EC > PERFORM BAD.
ᑍ
STOP RUN.
ᑍ
ᑍ End of Mainline
ᑍ
ᑍ
ᑍ Subroutine to perform if no errors were encountered.
ᑍ
GOOD.
OPEN OUTPUT LISTING.
MOVE HOLD-JOB-QUEUE TO HOLD.
WRITE LIST-LINE FROM HOLD-VALUE.
ᑍ
ᑍ Subroutine to perform if an error was returned in error code.
ᑍ
BAD.
OPEN OUTPUT LISTING.
MOVE EXCEPTION-ID TO MSGID.
B-20 System API Programming V4R1