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.

Start of changeIn 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. If the prototype is not specified, the RPG compiler will generate the prototype from the procedure interface. If the procedure does not contain a procedure interface, the RPG compiler will generate a prototype with 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.End of change

Use the CALL or CALLB operations to call a program or procedure when:
This chapter describes how to:

Feedback