IBM AS/400 manual Using the Fixed-Form Call Operations, CALLB only

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 173
Image 173

Using the Fixed-Form Call Operations

2.Optionally code an error indicator (positions 73 and 74) or an LR (positions 75 and 76) or both.

When a called object ends in error the error indicator, if spe Similarly, if the called object returns with LR on, the LR indicat set on.

3.To pass parameters to the called object, either specify a PLIS field of the call operation or follow the call operation immediate operations.

Either

operation transfers

control

from

the calling to

the called obje

called

object is

run,

control returns

to

the

first

operation that ca

the call operation

in

the

calling

program

or

procedure.

The following considerations apply to either call operation:

¹The Factor 2 entry can be a variable, literal, or named constant. entry is case-sensitive.

For CALL only: The Factor 2 entrylibrcaryn bename/program ,namefor

example, MYLIB/PGM1. If no library name is specified, then the li used to find the program. The name of the called program can be run time by specifying a character variable in the Factor 2 ent

For

CALLB only:

To make a procedure pointer

call you specify the

the

procedure

pointer which contains the

address of the procedu

¹A procedure can contain multiple calls to the same object with the different PLISTs specified.

¹When an ILE RPG procedure (including a program entry procedure) i called, the fields are initialized and the procedure is given c quent calls to the same procedure, if it did not end on the pr

fields,

indicators,

and

files

in

the

called procedure are the s

when

it returned on

the

preceding call.

 

 

 

 

¹ The

system

records

the

names

of

all

programs

called

within

an

RPG

When an RPG procedure is bound

into

a program

(*PGM)

you can

quer

names

using

DSPPGMREF,

although you cannot

tell which procedure

or

 

module

is

doing the

call.

 

 

 

 

 

 

 

If you call a program using a variable, you will see an entry w *VARIABLE (and no library name).

For a module, you can query the names of procedures called using DETAIL(*IMPORT). Some procedures on this list will be system procedur names of these will usually begin with underscores or contain blanks do not have to be concerned with these.

¹For CALLB only: The compiler creates an operational descriptor indic

number

of

parameters passed on the CALLB

operation

and

places this

the

*PARMS

field of the called procedure's program

status data

str

number

includes any parameters which

are

designated as

omitted

(

the

PARM

operation).

 

 

 

 

 

If

the

(D) operation extender is

used

with the

CALLB

operation

also creates an operational descriptor for each character and gr subfield.

Chapter 10. Calling Programs and Procedures149

Page 173
Image 173
IBM AS/400 manual Using the Fixed-Form Call Operations, CALLB only