A transfer statement transfers control from one main program to another, ending the source program. The source program can optionally pass a record into the input record of the target program. The target program can optionally use another transfer statement to transfer to the source program again (as in a menu program). You cannot use a transfer statement to transfer to a called program. For more about the difference between main and called programs, see Program part.
The program or transaction you transfer to is either generated by EGL or is considered externally defined. For externally defined programs, you must either set the isExternallyDefined property to YES on the transfer statement or create a transferToProgram or a transferToTransaction element in a linkage options part. For more information on this subject, see Using linkage options parts in a call or transfer.
The next table shows the valid transfers to or from EGL-generated code.
Transferring object | Target object |
---|---|
An EGL Java™ program that is outside of J2EE | An EGL Java program (non-J2EE) |
An EGL Java program that is in a J2EE application client | An EGL Java program in the same J2EE application client |
An EGL Java program in a J2EE Web application | An EGL Java program in the same J2EE Web application |
An EGL CICS® COBOL program | An EGL CICS COBOL program |
A non-EGL program that was written in any language and runs under CICS | |
An EGL z/OS® batch program | An EGL z/OS batch program |
A non-EGL batch program (written in any language and running outside of CICS on z/OS) | |
A non-EGL CICS program | An EGL CICS COBOL program |
A non-EGL CICS COBOL program | |
An EGL program on iSeries® | An EGL COBOL program on iSeries |
A non-EGL program (written in any language and running on iSeries) | |
A non-EGL program written in any language and running on iSeries | An EGL COBOL program on iSeries |
A non-EGL program written in any language and running on iSeries |
transfer to program com.CompanyB.CustomerPackage.processCustomer;
Platform | Issue |
---|---|
Batch environments (z/OS main batch program, IMS™ BMP, or Java main text or main batch program) | The transfer
to transaction statement
starts a program in the same run unit, but pre-transfer behavior depends
on
the setting of the synchOnTrxTransfer build
descriptor
option:
|
CICS for z/OS | A transfer to program does
not cause a synchronization point unless a PSB is scheduled when the
transfer
occurs and when one of the following situations is in effect:
EGL implements the transfer to program statement with the CICS XCTL command and uses the COMMAREA option of that command to pass the record, after which the record data starts in the first byte of the CICS common area. The targetName for a transfer to transaction statement must be a CICS transaction ID. The transfer to transaction statement commits recoverable resources, closes files, closes cursors, and starts a new transaction. EGL implements a transfer to transaction as a CICS START command. |
IMS BMP | If the receiving program was not generated by EGL or by VisualAge® Generator, EGL uses the OS XCTL macro to implement the transfer. In any case, it is not valid to transfer between a z/OS batch program and an IMS BMP program. |
IMS/VS | The following considerations apply:
|
Java | The transferToProgram and transferToTransaction elements of the linkage options part have no effect when you are transferring control from Java code to Java code. |
JSF | A transfer to transaction statement is not valid for page handlers (use the forward statement instead). |
Rich UI | The transfer statement is not supported. |
z/OS batch | See IMS BMP above |