Iᑍ
I/COPY QSYSINC/QRPGSRC,QWDRJOBD
Iᑍ
Iᑍ Command String Data Structure
Iᑍ
ICMDSTR DS
I I 'SNDMSG MSG(''HOLD - 1 26 CMD1
I 'value is '
I 27 36 HOLD
I I ''') TOUSR(QPGMR)' 37 51 CMD2
Iᑍ
IMSG2 DS
I I 'SNDMSG MSG(''Progr- 1 43 MSG2A
I 'am failed with mes-
I 'sage ID '
I 44 5 MSGIDD
I I ''') TOUSR(QPGMR)' 51 65 MSG2B
Iᑍ
Iᑍ Miscellaneous Data Structure
Iᑍ
I DS
I I 39 B 1 4RCVLEN
I I 'JOBD1' 5 12 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 the LFNAM.
Cᑍ
C JOBD CAT JOBDL LFNAM 2
Cᑍ
Cᑍ Error code parameter is set to 16
Cᑍ
C Z-ADD16 QUSBNB 15
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ᑍ
Cᑍ
C N1 MOVELQWDBHN HOLD
Cᑍ
Cᑍ Let's tell everyone what the hold value was for this job.
Cᑍ
C N1 Z-ADD51 LENSTR 155
C N1 CALL 'QCMDEXC'
C PARM CMDSTR
C PARM LENSTR
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ᑍ
Chapter 3. Common Information across APIs—Basic (OPM) Example
3-13