IBM AS/400 Frozen Dessert Maker User Manual


 
RPG Programming in ILE
step process, see Chapter 7, “Creating a Program with the CRTRPGMOD and
CRTPGM Commands” on page 73. For more information on service programs, see
Chapter 8, “Creating a Service Program” on page 91.
Program Management
ILE provides a common basis for:
Managing program flow
Sharing resources
Using application program interfaces (APIs)
Handling exceptions during a program's run time
It gives RPG users much better control over resources than was previously pos-
sible.
ILE programs and service programs are activated into activation groups which are
specified at program-creation time. The process of getting a program or service
program ready to run is known as activation. Activation allocates resources within a
job so that one or more programs can run in that space. If the specified activation
group for a program does not exist when the program is called, then it is created
within the job to hold the program's activation.
An activation group is the key element governing an ILE application's resources
and behavior. For example, you can scope commitment-control operations to the
activation group level. You can also scope file overrides and shared open data
paths to the activation group of the running application. Finally, the behavior of a
program upon termination is also affected by the activation group in which the
program runs.
For more information on activation groups, see “Managing Activation Groups” on
page 109.
You can dynamically allocate storage for a run-time array using the bindable APIs
provided for all ILE programming languages. These APIs allow single- and mixed-
language applications to access a central set of storage management functions and
offer a storage model to languages that do not now provide one. RPG offers some
storage management capabilities using operation codes. For more information on
storage management, see “Managing Dynamically-Allocated Storage” on page 113.
Program Call
In ILE, you can write applications in which ILE RPG programs and OPM RPG/400
programs continue to interrelate through the traditional use of dynamic program
calls. When using such calls, the calling program specifies the name of the called
program on a call statement. The called program's name is resolved to an address
at run time, just before the calling program passes control to the called program.
You can also write ILE applications that can interrelate with faster static calls. Static
calls involve 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 module consists of
an optional main procedure followed by zero or more subprocedures. Because the
Chapter 2. RPG Programming in ILE 19