IBM Version 4 manual Ipgmsts SDS Msgidd, Opm Rpg

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 61
Image 61

For RPG, the CALL operation specifies

the

error

indicator. Based

on w

error

indicator

is

on or off, a set of

instructions

can

be

process

receive

an error

code parameter that consists of a

binary

4

field

binary zeros.11/ (on page 3-10). The message ID can be

accessed from

program-status

data

structure. You

would define

this

as

follows:

 

I\ Program status DS (.12/ on page 3-9)

 

 

 

 

 

 

 

 

IPGMSTS

SDS

 

 

 

 

 

 

 

 

 

I

 

 

 

 

 

46 MSGIDD

 

 

 

 

 

If you

are

going

to do something

about

an error condition,

you

must

error

condition

in

RPG:

 

 

 

 

 

 

 

 

ŸIf you use the error-code data structure, test.13/theon bytes ava

page 3-14).

Ÿ If

you

let exceptions occur, test the error indicator.1ð/ on the CA

on

page

3-10).

Because you must test for some condition (one of the error message

Messages” on page 3-36), no great

difference exists in how you

hand

ditions in RPG. The error-code

data structure is a little more

strai

program-status data structure is not used). The

only

disadvantage

of

code data structure is that

the

escape

message

that occurred was

the

job log.

 

 

 

 

 

 

The

following program shows how

to

code for

an

error condition,

test

tion, and send a message to the QPGMR message queue if the conditi

I\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

I\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

I\

I\Program Name: JOBDAPI

I\

 

I\Language:

OPM RPG

I\

 

I\Descriptive Name: Get Job Description

I\

 

I\Description: This program handles any errors that are

I\

returned

I\

 

I\Header Files Included: QUSEC - Error Code Parameter

I\

QWDRJOBD - Retrieve Job Description API

I\

 

I\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

I\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

I\

 

 

 

I\ Error Code Parameter Include for the APIs

 

I\

 

 

 

I/COPY QSYSINC/QRPGSRC,QUSEC

 

 

I\

 

 

 

I\ Retrieve Job Description API Include

 

 

I\

 

 

 

I/COPY QSYSINC/QRPGSRC,QWDRJOBD

 

 

I\ Program status DS

 

 

IPGMSTS

SDS .12/

 

 

I

 

46 MSGIDD

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\

 

 

 

 

IMSG3

DS

 

 

 

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

Page 61
Image 61
IBM Version 4 manual Ipgmsts SDS Msgidd, Opm Rpg