Calling Programs and Procedures

In ILE, it is possible to call either a program or procedure. Furthermore, ILE RPG provides the ability to call prototyped or non-prototyped programs and procedures. (A prototype is an external definition of the call interface that allows the compiler to check the interface at compile time.)

The recommended way to call a program or procedure is to use a prototyped call. The syntax for calling and passing parameters to prototyped procedures or programs uses the same free-form syntax that is used with built-in functions or within expressions. For this reason, a prototyped call is sometimes referred to as a 'free-form' call.

In cases where there will be no RPG callers of a program or procedure, or where the procedure is not exported from the module, it is optional to specify the prototype. The RPG compiler can generate the prototype from the procedure interface, or from the lack of the procedure interface if the procedure has no return value and no parameters. It is still considered a prototyped call to call such a procedure that does not have an explicit prototype.

Use the CALL or CALLB operations to call a program or procedure when:

This chapter describes how to:



[ Top of Page | Previous Page | Next Page | Contents | Index ]