Handling Error

Conditions—ILE RPG Example

 

 

 

 

 

Refer

to “Handling

Error Conditions—OPM RPG Example” on

page 3-8 for the o

 

 

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

46

 

 

 

 

D\

 

 

 

 

 

 

 

D\

Command string data structure

 

 

 

 

 

D\

 

 

 

 

 

 

 

DCMD_STRING

DS

 

 

 

 

 

D

 

 

26

INZ('SNDMSG MSG(''HOLD value is ')

 

 

D HOLD

 

 

 

 

 

D

 

 

15

INZ(''') TOUSR(QPGMR)')

 

 

 

D\

 

 

 

 

 

 

 

D\

Miscellaneous data structure

 

 

 

 

 

D\

 

 

 

 

 

 

 

DRCVLEN

S

9B ð INZ(%SIZE(QWDDð1ðð))

 

 

 

DFORMAT

S

8

INZ('JOBDð1ðð')

 

 

 

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

 

 

C

 

PARM

 

JOBD_LIB

 

 

C\

 

 

 

 

 

B-8

System API

Programming V4R1

 

 

 

 

Page 286
Image 286
IBM Version 4 manual Handling Error