\

\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-JOBDð1ðð, RECEIVER-LENGTH, FORMAT-NAME, JOBD-AND-LIB-NAME, QUS-EC.

\

\If no bytes available, API was successful; print HOLD valu￿e

IF BYTES-AVAILABLE OF QUS-EC = ð PERFORM GOOD.

\If some bytes available, API failed; print Error message I￿D

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 c￿ode.

BAD.

OPEN OUTPUT LISTING.

MOVE EXCEPTION-ID TO MSGID.

B-20System API Programming V4R1

Page 298
Image 298
IBM Version 4 manual Procedure Division Using JOBD, JOBDL. MAIN-LINE, BAD Open Output Listing Move EXCEPTION-ID to Msgid