Object Modules (VSE/ESA)
Generating phases: Before you can use an object module, you must combine it with the appropriate stub (a stub transforms input parameters into a form understandable by the compiled REXX program), then you must link-edit it to generate a phase.
With the cataloged procedure REXXLINK supplied by IBM®, you can create a phase consisting of a single program in one step (see REXXLINK Cataloged Procedure (VSE/ESA)).
To create a phase consisting of multiple programs (if you have used the DLINK compiler option), you must combine each object module with the appropriate stub by means of the cataloged procedure REXXPLNK supplied by IBM (See REXXPLNK Cataloged Procedure (VSE/ESA)). You must then link-edit the resulting object modules in an additional step to generate a phase.
- VSE for invocation by means of VSE JCL.
- EFPL (external function parameter list) for invocation with the REXX CALL instruction or as a function. This must be used when building a function package.
After you have combined the object modules with the appropriate stubs and linked them together, you can use the resulting phases in the same way you use phases of high-level language compilers.
Invoking a REXX program as a phase: A program linked with the VSE stub enables you to invoke a REXX program just as you would invoke a program written in another high-level language.
Improving packaging and performance: If your application includes many REXX programs, you can create one phase that contains all the REXX programs. You can package it more compactly, thereby reducing system load, because the application spends less time searching for and invoking external functions and subroutines. To generate a single phase:
- Specify the DLINK compiler option when you compile programs on z/OS® or z/VM® that invoke external subroutines and functions whose references are intended to be resolved.
- Generate the object module on z/VM or z/OS and send it to VSE/ESA.
- Use the REXXPLNK cataloged procedure to combine the main program with the appropriate stub for the intended invocation.
- Use the REXXPLNK cataloged procedure to combine each external subroutine and function with an EFPL stub.
- Link-edit all the combined object modules together into a single phase.
Building function packages: The parts of a function package can be written in REXX, compiled, combined with the EFPL stub using REXXPLNK, and then linked to the function packages, in which they are defined as external routines. See the IBM VSE/ESA REXX/VSE Reference manual for details about function packages.
Writing parts of applications in REXX: You can link-edit the object modules that are already combined with the appropriate stub with other object modules written in another programming language. The language used must be able to provide the parameters in one of the supported parameter-passing conventions. Otherwise, you can write your own stub to support the parameter-passing convention of the language in question, modeled after one of the existing stubs. See Stubs for more information.
Including a copyright notice in your program: You can provide stubs containing a copyright notice. The stubs supplied by IBM contain comments that show where the copyright notice can be easily added. The member names of the stubs are EAGSDVSE and EAGSDEFP.