Format

 

of an

Error

Code

Structure

 

 

 

The

format

of

the

error code structure (QUSBN) is:

 

 

 

 

 

 

 

 

 

Offset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Dec

 

Hex

Use

 

 

Type

Field

 

 

 

 

 

 

 

 

 

 

0

 

0

INPUT

 

BINARY(4)

Bytes

provided

 

 

 

 

 

 

 

 

4

 

4

OUTPUT

 

BINARY(4)

Bytes

available

 

 

 

 

 

 

 

 

8

 

8

OUTPUT

 

CHAR(7)

Exception

ID

 

 

 

 

 

 

 

 

15

 

F

OUTPUT

 

CHAR(1)

Reserved

 

 

 

 

 

 

 

 

 

16

 

10

OUTPUT

 

CHAR(*)

Exception

data

 

 

 

 

 

 

 

 

 

 

The error

code

structure

can

be

found

in the

QSYSINC

library

in the

QUSEC (see.14/ on

page 3-12). Which of the files you use

depends on

guage. For

more

information

on

the

QSYSINC

library,

see

“APIs

and

the

QSYSINC Library”

on page 2-28.

 

 

 

 

 

 

 

The bytes provided field describes the size of the error code st

declared

in

your

program

 

and

how

you want

errors

returned. (This

was

shown by.6/ on page

3-7

 

in the JOBDAPI example on page 3-6.)

 

 

The

bytes

available

field

describes how many bytes the API

could ha

back. If

this

field

is

zero,

no

exception

occurred. The

correct

meth

an

error

occurred

when

using

a

nonzero-bytes-provided

value is

to

chec

for a value greater .than13/

onzeropage( 3-14).

 

 

 

 

 

 

The exception ID is the

normal 7-character message ID, such as CPF9801,

occurs for an object-not-found condition. Do

not test

this

field

to

det

error exists. The field is properly set by the system

only if the

available

is

greater

than

0. Similarly, the exception data (message dat

tion

is not

set

properly

 

unless

an

error exists;

for

example,

any

info

a prior

call is

not

changed.

 

 

 

 

 

 

 

 

 

The following program is the same as the previous program except that error code structure is used:

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

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

I\

I\Program Name: JOBDAPI

I\

 

I\Language:

OPM RPG

I\

 

I\Descriptive Name: Get Job Description

I\

 

I\Description: This sample program shows exceptions bein￿g

I\

returned in the error code parameter.

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 .14/

I\

I\ Retrieve Job Description API Include

3-12System API Programming V4R1

Page 64
Image 64
IBM Version 4 manual Format Error code structure Qusbn is, Error Code Structure Can Found