Calling ILE RPG Programs and Procedures

An ILE COBOL program can call ILE RPG programs and procedures using dynamic program calls or static procedure calls.

When a dynamic program call is used to call an ILE RPG program, the ILE RPG program must be compiled and bound as a separate program object. When a static procedure call is used to call an ILE RPG procedure, the ILE RPG procedure must first be compiled into a module object and then bound to the calling ILE COBOL program. Refer to the IBM® Rational® Development Studio for i: ILE RPG Programmer's Guide for a description of compiling and binding ILE RPG programs and procedures.

You call an ILE RPG program or procedure from an ILE COBOL program by using the CALL literal statement (where literal is the name of the ILE RPG program or procedure). To call the ILE RPG program or procedure, you write the CALL literal statement in the same way as you would if you were calling another ILE COBOL subprogram. See Using Static Procedure Calls and Dynamic Program Calls for detailed information about how to write the CALL statement in your ILE COBOL program to call an ILE RPG program using dynamic program calls or static procedure calls.

You can also call an ILE RPG program from an ILE COBOL program by using the CALL identifier statement. See Using CALL identifier for more information on CALL identifier.