IBM AS/400 Frozen Dessert Maker User Manual


 
Binding Modules into a Program
Binding Modules into a Program
Binding is the process of creating a runnable ILE program by combining one or
more modules and optional service programs, and resolving symbols passed
between them. The system code that does this combining and resolving is called a
binder on the AS/400 system.
As part of the binding process, a procedure must be identified as the startup proce-
dure, or program entry procedure. When a program is called, the program entry
procedure receives the parameters from the command line and is given initial
control for the program. The user's code associated with the program entry proce-
dure is the user entry procedure.
If an ILE RPG module contains a main procedure, it implicitly also contains a
program entry procedure. Therefore, any ILE RPG module may be specified as the
entry module as long as it is not a NOMAIN module.
Figure 40 gives an idea of the internal structure of a program object. It shows the
program object TRPT, which was created by binding the two modules TRANSRPT
and TRANSSVC. TRANSRPT is the entry module.
TRANSRPT Module
TRANSSVC Module
Program Entry
Procedure
Main Source Section
Main Procedure
Trans_Inc
Prod_Name
*PGM(TRPT)
Figure 40. Structure of Program TRPT
Within a bound object, procedures can interrelate using static procedure calls.
These bound calls are faster than external calls. Therefore, an application con-
sisting of a single bound program with many bound calls should perform faster than
a similar application consisting of separate programs with many external interappli-
cation calls.
Chapter 7. Creating a Program with the CRTRPGMOD and CRTPGM Commands 81