Iᑍ
I DS
I I 1 B 1 4RCVLEN
II B 5 8X
I I 'JOBD1' 9 16 FORMAT
Cᑍ
Cᑍ Beginning of Mainline
Cᑍ
Cᑍ Two parameters are being passed into this program.
Cᑍ
C ᑍENTRY PLIST
C PARM JOBD 1
C PARM JOBDL 1
Cᑍ
Cᑍ Move the two parameters passed into LFNAM.
Cᑍ
C JOBD CAT JOBDL LFNAM 2
Cᑍ
Cᑍ Error code Parameter is set to 1
Cᑍ
C Z-ADD1 QUSBNB
Cᑍ
Cᑍ Instead of specifying 'QWCRJOBD', I could have used the
Cᑍ constant QWDBGB that was defined in the QWDRJOBD include.
Cᑍ
C CALL 'QWDRJOBD'
C PARM QWDBH Receiver Var.
C PARM RCVLEN Length RCVVAR
C PARM FORMAT Format Name
C PARM LFNAM Qual. Job Desc
C PARM QUSBN Error Code
Cᑍ See if any errors were returned in the error code parameter.
C EXSR ERRCOD
Cᑍ
C N1 Z-ADD47 LENSTR 155
Cᑍ
C N1 QWDBH8 ADD 1 X
C N1 1 DO QWDBH9
C 1 SUBSTQWDBH:X LIB
Cᑍ
Cᑍ Let's tell everyone what the library value is.
Cᑍ
C CALL 'QCMDEXC'
C PARM CMDSTR
C PARM LENSTR
C ADD 11 X
C X IFGE RCVLEN
C LEAVE
C ENDIF
C ENDDO
Cᑍ
C SETON LR
C RETRN
Cᑍ
Cᑍ End of MAINLINE
Cᑍ
Cᑍ
Cᑍ Subroutine to handle errors returned in the error code
Cᑍ parameter.
Cᑍ
C ERRCOD BEGSR
C QUSBNC IFGT
C SETON 1 Error on API Call
Cᑍ
Cᑍ Process errors returned from the API.
Cᑍ
C END
C ENDSR
Note: It is important to access the count and to compare for the exact number of
libraries to be processed. If you do not check for the exact number of
Chapter 3. Common Information across APIs—Basic (OPM) Example 3-23