I\
I DS
I I 1ððð B 1 4ðRCVLEN
II ð B 5 8ðX
I I 'JOBDð1ðð' 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 Nð1 Z-ADD47 LENSTR 155
C\
C Nð1 QWDBH8 ADD 1 X
C Nð1 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