I\
I\ Retrieve Job Description API Include
I\
I/COPY QSYSINC/QRPGSRC,QWDRJOBD.2/
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\
I\ Miscellaneous Data Structure
I\
I DS
I\ .3/ .4/
I I 39ð B 1 4ðRCVLEN
I I 'JOBDð1ðð' 5 12 FORMAT
I\ .5/
C\
C\ Beginning of Mainline
C\
C\ Two parameters are being passed into this program.
C\
C \ENTRY PLIST .8/
C PARM JOBD
C PARM JOBDL
C\
C\ Move the two parameters passed into LFNAM.
C\
C JOBD CAT JOBDL LFNAM .9/
C\ Error code bytes provided is set to ð
C\
C Z-ADDð QUSBNB .6/
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\
C MOVELQWDBHN HOLD
C\
C\ Let's tell everyone what the hold value was for this jobd.
C\
C Z-ADD51 LENSTR 155
C CALL 'QCMDEXC'
C PARM CMDSTR
C PARM LENSTR
C\
C SETON LR
C RETRN
C\
C\ End of MAINLINE
C\

The program declares the variables to be used. The QWDBH variable is length

390 as shown by .3/ on page 3-7.

In the example, the program places a value of JOBD0100 in the format variable. A

literal could have been used instead for those languages that support a literal on a

call .5/. (For program examples in other languages, see “Original Program Model

(OPM) APIs—Examples” on page B-2.) The program generates the qualified name

of the job description (JOBD) by concatenating the simple name and the library

Chapter 3. Common Information across APIs—Basic (OPM) Example 3-7