transfer

The EGL transfer statement gives control from one main program to another, ends the transferring program, and optionally passes a record whose data is accepted into the receiving program's input record. You cannot use a transfer statement in a called program.

Your program can transfer control by a statement of the form transfer to a transaction :

The linkage options part, transferLink element has no effect when you are transferring control from Java code to Java code, but is meaningful otherwise.

If you are transferring control code to code that was not written with EGL or VisualAge Generator, it is recommended that you set the linkage options part, transferLink element. Set the linkType property to externallyDefined.

If you are running in VisualAge Generator compatibility mode, you can specify the option externallyDefined in the transfer statement, as occurs for programs migrated from VisualAge Generator; but it is recommended that you set the equivalent value in the linkage options part instead. For details on VisualAge Generator compatibility mode, see Compatibility with VisualAge Generator.


Syntax diagram for the transfer statement

program targetName (the default)

The program that receives control. I

transaction targetName

The program that receives control, as described earlier.

sysVar.transferName

A system function that contains a target name that can be set at run time. For details, see sysVar.transferName.

passing recordName

A record that is received as the input record in the target program. The passed record may be of any type, but the length and primitive types must be compatible with the record that receives the data. The input record in the target program must be of type basicRecord.

Related concepts
Compatibility with VisualAge Generator
Name aliasing

Related reference
sysVar.transferName