IBM Version 4 manual Because the field is a binary, Would Make Binary Value, This Name

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 56
Image 56

the size of the variable in your program. In the example program in Statement—Parameter Example” on page 3-2, RCVLEN is the length of receiver variable parameter.

The length field, according to the required parameter group, must be

BINARY(4). This means that a field

of

4

 

bytes

is

passed

where

the

fied

in

 

binary. You

need

to

know

how

your

high-level

language

allows

 

yo

a 4-byte field and place a binary value in it. The API

does

 

not

 

ca

declared

as

a

binary

type. For example,

 

some

languages,

like

control

la

(CL),

 

do

not have a binary type.

What is important is that the

field

length

and

that

it

contains

the

receiver

 

length

in

binary.

 

 

 

 

 

 

If

 

you

write

 

programs

in

CL,

you

need

the

%BIN

function

to

 

convert

a

or

variable

to

 

a character

field

that

is

declared

as

4

bytes. If

RPG,

 

you

 

can declare a data structure

that contains

a

4-byte

 

field

and

 

is

defined

as

 

B .4/for onbinparyge

(3-7). Because the field is a binary

type,

RPG

would

make

a

binary

value.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Format

 

Name:

 

 

A

format

name

is

a

name that

identifies

what

type

 

of

 

inf

you want returned in the receiver

variable. Because this API has a

name, JOBD0100, you would use the

format

.name5/ ongivenpage( 3-7)

in

 

the

 

 

 

Retrieve Job Description Information API. The format name

variable

in

t

example

program

 

is

called

FORMAT. You

can

place

the

format

name

in

a

va

or

pass

it

as

 

a

literal.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Qualified

 

Job

Description

 

Name:

 

 

 

This

 

name

must

be

passed

as a

20-character

name

 

with

the

job

description

 

name

in

the

first

10

characters

and

th

ifier beginning in the 11th character. If you want JOBD1 in LIBX, specify:

1

11

.

.

.

.

.

.

JOBD1

LIBX

 

The special values of *CURLIB or *LIBL can be used as the library q

Note: APIs generally do not convert parameter values to uppercase. When object names (like job description and library), you must provide in uppercase.

Error Code:

This

parameter allows

you

to

select

how

errors

are

to

be

The

include

file QUSEC

contains

the

definition

for

the

error

code

stru

used

for

 

the

error

code

parameter.

 

 

 

 

 

 

 

 

You

can choose to receive exceptions

(escape messages)

or

to

receiv

code

data

 

structure

that

allows you

to determine

if

an

exception

occ

Depending on

your

high-level language, you

may not have

a choice for w

method you

use.

You

may have

to

use the error-code

data structure

some languages do

not

provide

for

escape

messages.

 

In the example in “Retrieving the Hold Parameter (Exception Message)—OPM Example” on page 3-6, the RPG program requests that exceptions be sent errors occur. To provide for this type of exception handling, a 4-byt

3-4System API Programming V4R1

Page 56
Image 56
IBM Version 4 manual Because the field is a binary, Would Make Binary Value, Can Place Format Name Pass Literal, This Name