1 X PIC S9(9) BINARY.
ᑍ
ᑍ Job Description and Library Name Structure
ᑍ
1 JOBD-AND-LIB-NAME.
5 JOB-DESC PIC X(1).
5 JOB-DESC-LIB PIC X(1).
ᑍ
LINKAGE SECTION.
ᑍ
ᑍ 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 1.
ᑍ
MOVE 1 TO BYTES-PROVIDED.
ᑍ
ᑍ Receiver Length Set to 1.
ᑍ
MOVE 1 TO RECEIVER-LENGTH.
ᑍ
ᑍ Call the QWDRJOBD API.
ᑍ
CALL QWDRJOBD USING RECEIVER-VARIABLE, RECEIVER-LENGTH,
FORMAT-NAME, JOBD-AND-LIB-NAME, QUS-EC.
ᑍ
ᑍ See if any errors were returned in the error code parameter.
ᑍ
PERFORM ERRCOD.
ᑍ
ᑍ Add one to the Initial library list offset because COBOL is a
ᑍ Base 1 language.
ᑍ
MOVE OFFSET-INITIAL-LIB-LIST TO X.
ADD 1 TO X.
MOVE 47 TO COMMAND-LENGTH.
ᑍ
ᑍ Let's tell everyone what the library value was for this job.
ᑍ
PERFORM NUMBER-LIBS-IN-LIB-LIST TIMES
MOVE RECEIVER-VARIABLE(X:1) TO LIB,
CALL QCMDEXC USING COMMAND-STRING, COMMAND-LENGTH,
ADD 11 TO X,
PERFORM RECLEN,
END-PERFORM.
B-28 System API Programming V4R1