cedure passes parameters in the manner expected by the called API. ILE HLL programmer's guides contain more information on passing parameters different languages.

The ILE languages support the following parameter-passing styles:

ŸILE C passes and accepts parameters by value (directly and indire reference.

ŸILE COBOL and COBOL support the passing of parameters by value (indi

rectly)

and

by

reference.

Ÿ ILE RPG

and

RPG

support the passing of parameters by reference.

ŸILE CL and CL support the passing of parameters by reference.

Parameter Classification

Parameters can be classified into the following general categories:

Ÿ

Input

parameters:

These parameters must

be

set

to

a

value

before

 

API

because they

pass

needed

information

to the

API

to enable

it

 

function. For

example,

if

the

API

is

to

perform

a

function

on

an

ob

 

the

parameters

would

be

the name and library of

that

object. Inpu

 

are

not changed

by

the

API.

 

 

 

 

 

 

 

 

 

 

 

 

Ÿ

Output

parameters: These

parameters

do

not

need

to

be

set

 

before

 

API because the API returns

information

to

the

application

in

these

 

When a return to the application is successful and no errors have

 

application

then

accesses

the

information returned in

output

paramete

ŸInput/Output parameters: These are parameters that are identified

tures that contain fields. The fields within the structure can be output, or both. For example, the bytes provided field in the erro eter is an input field. The rest of the fields that make up this output fields. The rules for input parameters and output parameters the individual fields in the structure.

Error Code Parameter

The error code parameter is a variable-length structure that is a pa APIs. (UNIX-type APIs and ILE CEE APIs do not use the error code str The error code parameter controls how errors are returned to the app

parameter

must

be initialized

before the

program

 

calls

the

API. Depend

the error code structure is

set,

this

parameter

either

returns

infor

with

an

error

condition or

causes

errors

to

be

returned

as

exception

For some APIs, the error code parameter is optional. If

you

do

not

c

optional

error

code

parameter,

the

API

returns

diagnostic

and

escape

 

you code the optional error code

parameter,

the

 

API

can

 

either

signa

return

the exception

information

in

the

error

code

parameter.

 

 

 

The structure for the error code

parameter

is

discussed

in

the

topi

Error Code Structure” on page 3-12. It contains information

about the

e

fields. Although

the

information

is about

an

RPG

example,

the

information

for

other

APIs.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Note:

The

error

code

structure

is

provided

in

the

QSYSINC

library

and

 

 

QUSEC. Refer

to

Figure 2-5

on

page 2-28 for a list of

 

include

file

 

shipped in

the

QSYSINC

library.

 

 

 

 

 

 

 

 

 

 

 

 

2-8System API Programming

V4R1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Page 28
Image 28
IBM Version 4 manual Parameter Classification, Error Code Parameter