In ILE, you can write applications in which ILE RPG/400 programs and OPM RPG/400 programs interrelate by using the traditional dynamic program call. The calling program specifies the name of the called program on a CALL statement. The name of the called program is resolved to an address at run time, just before the calling program passes control to the called program. The program name may be known to the program only when the call is made (perhaps if the program to be called is a variable value). Because of this, the dynamic call uses considerable system resources, and repeated dynamic calls can reduce the performance of the calling program.
You can also write ILE applications that interrelate with faster static calls. Static calls are calls between procedures. A procedure is a self-contained set of code that performs a task and then returns to the caller. An ILE RPG/400 module consists of an optional main procedure followed by zero or more subprocedures. Because the procedure names are resolved at bind time (that is, when you create the program), static calls are faster than dynamic calls.
Example: The CA 2E generator uses static calls where possible. Suppose a model contains the following external functions Function PGM—generated in RPGIV, compiled as a program object (*PGM)
Function MOD—generated in RPGIV, compiled as a module object (*MODULE)
Function MOD2—generated in RPGIV, compiled as a module object (*MODULE)
Function RPG—generated in RPG or COBOL, compiled as a program object (*PGM)
In a model with the functions just listed, the following call situations occur:
|
Copyright © 2014 CA.
All rights reserved.
|
|