Transferring control between EGL-generated COBOL and native programs on IBM i

This topic considers transfers between EGL-generated COBOL programs and native programs written in COBOL or RPG.

Transferring between EGL-generated and non-EGL generated COBOL

On IBM® i, the following types of transfer of control are possible between EGL-generated and non-EGL generated COBOL programs:
  • Using the call statement.
  • Using the transfer to program statement.
  • Using the transfer to transaction statement.

IBM i does not support the show statement to transfer to a non-EGL program.

If you are calling a non-EGL program from an EGL program, the call uses the standard IBM i CALL interface. Parameters are passed using a standard system argument list.

When you use the transfer to program or transfer to transaction statement, control is passed directly to the target program using the IBM i XCTL interface. If a record is specified, it is passed as a parameter using a standard system argument list. The transferring program is removed from the program invocation stack and does not resume control when the target program ends.

Transferring between EGL-generated COBOL and non-EGL generated RPG

On IBM i, the following types of transfer of control are possible between EGL-generated COBOL programs and non-EGL generated RPG programs:
  • Using the call statement.
  • Using the transfer to program statement.
  • Using the transfer to transaction statement.

IBM i does not support the show statement to transfer to a non-EGL program.

If you are calling a non-EGL program from an EGL program, the call uses the standard IBM i CALL interface. Parameters are passed using a standard system argument list.

When you use the transfer to program or transfer to transaction statement, control is passed directly to the target program using the IBM i XCTL interface. If a record is specified, it is passed as a parameter using a standard system argument list. The transferring program is removed from the program invocation stack and does not resume control when the target program ends.


Feedback