C

 

 

ERRCOD

BEGSR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C

 

 

QUSBNC

IFGT ð

.13/

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C\ Process errors returned from the API.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

 

SETON

 

 

 

 

 

ð1

 

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

 

Z-ADD65

 

LENSTR 155

 

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

 

MOVELQUSBND

 

MSGIDD

 

 

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

 

CALL 'QCMDEXC'

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

 

PARM

 

 

 

MSG2

 

 

 

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

 

PARM

 

 

 

LENSTR

 

 

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

 

END

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

 

ENDSR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The QUSBN error-code

 

data structure is defined in the.14/includeon

file Q

page 3-12), and

the

 

program

initializes

the

bytes

provided

field

(QU

value of

.1615/

(on

page

3-13). This sets the

first field

of

the

error

to

tell

the

API

not

 

to send an exception but to use the first 16 b

parameter

 

to

 

return

the

error information. After the CALL to the API, t

accesses

the

bytes

 

available .13/(QUSBNC)on page(

3-14). This

contains

the

 

number

of

bytes

of

 

information about the error condition.

The

program

that it tests if the number exceeds zero. This is the

correct

meth

whether

an

error has

occurred.

 

 

 

 

 

 

 

 

 

 

 

If

an

error

 

occurred,

you may want to handle the error in many dif

The

program

shown

extracts

the

specific

error message ID that occurr

the

7-character

value

as

a

message. The

QUSBN parameter is used for

and

output

(see

“Format

of

an

Error

Code

 

Structure”

on

page 3-12). The

bytes

are

input

to

 

the

API

 

to

tell it

how to handle exceptions. The

are

output

from

the

 

API

about

any

exception

conditions.

 

 

 

 

To see the value of

the HOLD attribute, use the following call statem

program

against

the

QBATCH

job

description

 

in

library

QGPL:

 

 

 

 

CALL JOBDAPI (QBATCH QGPL)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

You

should

see

that

 

the

value

of

the

HOLD

attribute

is

*NO:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

à

 

 

 

Display Messages

 

 

 

ð

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

System:

GENSYS9ð

 

 

 

 

 

Queue . . . . . :

QPGMR

Program . . . . :

\DSPMSG

 

 

 

 

 

Library . . . :

QUSRSYS

Library . . . :

 

 

 

 

 

 

Severity

. . . :

ðð

 

Delivery . . . :

\HOLD

 

 

 

 

 

Type reply (if required), press Enter.

 

 

 

 

 

 

 

 

From

. . . :

SMITH

ð7/23/94

1ð:25:14

 

 

 

 

 

 

HOLD value is \NO

 

 

 

 

 

 

 

 

Handling

Error

Conditions—OPM RPG

Example

 

 

 

 

 

 

For this

error

condition,

you

should

assume

that the XYZ

job descript

exist. Use

the

following

call

statement to

run the error

condition:

CALL JOBDAPI (XYZ \LIBL)

You should see that the CPF9801 message (Object not found) was issued:

3-14System API Programming V4R1

Page 66
Image 66
IBM Version 4 manual Qgpl