Overview of linkage options part
- How a generated Java™ program or wrapper calls other generated code
- How a generated COBOL program calls and is called by other generated code
- How a generated Java™ or COBOL program starts another program asynchronously
- How a generated Java™ or COBOL program transfers control and ends processing.
- How a generated CICS® COBOL program accesses files on remote CICS® regions
Specifying when linkage options are final
- The linkage options specified at generation time are in effect at run time; or
- If you are using the callLink element,
the linkage options specified in a linkage properties file at deployment
time are in effect at run time. Although you can write that file by
hand, EGL generates it in this situation:
- You set the linkage options callLink element remoteBind property to RUNTIME; and
- You generate a Java™ program or wrapper with the genProperties build descriptor option set to GLOBAL or PROGRAM.
For details on using the file, see Linkage properties file.
Elements of a linkage options part
The linkage options part is composed of a set of elements, each of which has a set of properties and values. The following types of elements are available:
- A callLink element specifies the linkage
conventions that EGL uses for a given call.
- If you are generating a COBOL program, the following relationships
are in effect:
- If the callLink element refers to the generated program, that element determines aspects of the program's own parameters; for example, whether the program expects pointers to data or expects the data itself. Also, that element helps determine whether to generate a Java™ wrapper that allows access to the COBOL code from native Java™ code; for an overview, see the topic "Generating a Java™ wrapper".
- If the callLink element refers to a program being called by the generated program, that element specifies how the call is implemented; for example, whether the call is local or remote.
- If you are generating a Java™ program
that calls another program, and the callLink element
refers to the called program, the callLink element
specifies how the call is implemented; for example, whether the call
is local or remote.
If you indicate that the calling Java™ program makes the call through an EJB session bean, the callLink element causes generation of an EJB session bean.
- If you are generating a COBOL program, the following relationships
are in effect:
- An asynchLink element specifies how a generated Java™ or COBOL program starts another EGL-generated or VisualAge® Generator program asynchronously. This occurs when the transferring program invokes the vgLib.startTransaction system function.
- A transferToProgram element specifies how a generated program transfers control to a program and ends processing. This element is meaningful only for a main program that issues a transfer to program statement.
- A transferToTransaction element specifies how a generated program transfers control to a transaction and ends processing. This element is meaningful only for a main program that issues a transfer to transaction statement.
- A fileLink element specifies how a CICS® COBOL program accesses a particular VSAM file or transient data queue.
Identifying the programs, files, or records that elements reference
In each element of a linkage options part, a property (for example, pgmName) identifies the programs, files or records that the element references; and unless otherwise stated, the value of that property can be a valid name, an asterisk, or the beginning of a valid name followed by an asterisk. The asterisk is the wildcard equivalent of one or more characters and provides a way to identify a set of names.
Consider a callLink element that includes the following value for the pgmName property:
myProg*
That element pertains to any EGL program part that begins with the letters myProg.
If multiple elements are valid, EGL uses the first element that applies. A series of callLink elements, for example, might be characterized by these pgmName values, in order:
YourProgram
YourProg*
*
Consider the element associated with the last value, where the value of pgmName is only an asterisk. Such an element could apply to any program; but in relation to a particular program, the last element applies only if the previous elements do not. For example, if your program calls YourProgram01, the linkage specified in the second element (YourProg*) supersedes the third element (*) to define how EGL handles the call.
In most cases, elements with more specific names should precede those with more general names. In the previous example, the element with the asterisk is appropriately positioned to provide the default linkage specifications.
File01
File*
*
When your program accesses a file named File01, the first element identifies how CICS® accesses that file. However, when your program accesses a file named Personnel, the last element applies and provides the default information for how to handle the file.