Handling Error Conditions—ILE RPG Example
Refer to “Handling Error Conditions—OPM RPG Example” on page 3-8 for the ori-
ginal example. This example can be written only in OPM RPG and ILE RPG.
Dᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
Dᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
Dᑍ
Dᑍ Program Name: JOBDAPI
Dᑍ
Dᑍ Programming Language: ILE RPG
Dᑍ
Dᑍ Description: This program retrieves the HOLD value from
Dᑍ a job description. It expects errors to be
Dᑍ sent as escape messages.
Dᑍ
Dᑍ Header Files Included: QUSEC - Error Code Parameter
Dᑍ QWDRJOBD - Retrieve Job Description API
Dᑍ
Dᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
Dᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
Dᑍ
Dᑍ Error Code parameter include
Dᑍ
D/COPY QSYSINC/QRPGLESRC,QUSEC
Dᑍ
Dᑍ Retrieve Job Description API Include
Dᑍ
D/COPY QSYSINC/QRPGLESRC,QWDRJOBD
Dᑍ
Dᑍ Program status DS
Dᑍ
DPGMSTS SDS 12
D MSG_ID 4 46
Dᑍ
Dᑍ Command string data structure
Dᑍ
DCMD_STRING DS
D 26 INZ('SNDMSG MSG(''HOLD value is ')
D HOLD 1
D 15 INZ(''') TOUSR(QPGMR)')
Dᑍ
Dᑍ Miscellaneous data structure
Dᑍ
DRCVLEN S 9B INZ(%SIZE(QWDD1))
DFORMAT S 8 INZ('JOBD1')
DLENSTR S 15 5 INZ(%SIZE(CMD_STRING))
DNO_JOBD S 47 INZ('SNDMSG MSG(''No such ᑍJOBD -
D exists'') TOUSR(QPGMR)')
DNO_JOBD_SZ S 15 5 INZ(%SIZE(NO_JOBD))
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 JOBD_LIB 1
Cᑍ
B-8 System API Programming V4R1