nonobject information that represents data known to the system, such as mation or system status.

Description of an API

Most APIs have similar topic headings. The following lists the API topic each with an overview and details on how to use the information.

Parameters

The Parameters box describes how to call the API. The first column in eters box lists the required order of the parameters. The second co

parameter

used

on

the

call.

 

 

 

 

 

 

 

 

 

The

third

column

lists

whether

the parameter

is

defined

for

input,

out

and

output. Input

parameters

and

fields

are

not

changed

by

the

API.

the

same

value

on the return from the API call as they do

before

t

contrast,

output

parameters are

changed. Any

information that

an API call

in an output parameter or output

field

before

the call

to

the

API

c

return from the

call

to

the

API.

 

 

 

 

 

 

 

In the fourth column of the Parameters box is the type of data de parameter. CHAR(*) represents a data type that is not known, such as c binary, and so on, or a length that is x)notrepresentsknown. xBinary(bytes of a binary value. CHAR(x) representsx bytes of character data. When calling the QWDRJOBD API, for example, there is an 8-byte character format name, binary value named length of receiver variable, and a variable-length re able. The receiver variable is a structure made up of several charac fields. For more information on format names, see “Format Name” on page 3-

RPG Call

Statement—Parameter

Example:

 

In

this

example

program,

you

must

pass

 

5

parameters

to

use

the

API. For

example,

your RPG

CALL

statement

look

like

the

following:

 

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

 

CALL 'QWDRJOBD'

 

 

 

 

 

 

 

 

C

 

 

 

 

 

PARM

 

QWDBH

 

Receiver Var.

 

 

 

C

 

 

 

 

 

PARM

 

RCVLEN

 

Length QWDBH

 

 

 

C

 

 

 

 

 

PARM

 

FORMAT

 

Format Name

 

 

 

C

 

 

 

 

 

PARM

 

LFNAM

 

Qual. Job Desc

 

 

C

 

 

 

 

 

PARM

 

QUSBN

 

Error Code

 

 

Note:

There is no parameter for the HOLD information. The first paramet

 

 

receiver

variable (QWDBH),

is

where

the

information

is

passed ba

 

 

the

job

description

API.

You

will

receive

a

data

structure that

 

 

mation, and you will need

to find the specific location within th

 

 

ture

for where

the

HOLD

information

is stored.

 

 

Authorities

and

Locks

 

 

 

 

 

 

The

 

Authorities and

Locks

topic lists

all

the authorities that you need

API.

This

topic also lists the locks

that the API uses. To use an API,

have

the

correct

authority

to

the

following:

Ÿ

The

API

itself

 

 

 

 

 

 

Ÿ

All

 

the

objects

that

the

API

uses

 

Ÿ

Any

locks

that the API places

on

any

objects

3-2System API Programming V4R1

Page 54
Image 54
IBM Version 4 manual Description of an API, Parameters, Locks, Authorities