Creating a Program with the CRTBNDRPG Command
This chapter shows you how to create an ILE program using RPG IV source
with the Create Bound RPG Program (CRTBNDRPG) command. With this command you
can create one of two types of ILE programs:
- OPM-compatible programs with no static binding
- Single-module ILE programs with static binding
Whether you obtain a program of the first type or the second type depends on whether the DFTACTGRP parameter of CRTBNDRPG is set to *YES or *NO respectively.
Creating a program of the first type produces a program that behaves like an OPM program in the areas of open scoping, override scoping, and RCLRSC. This high degree of compatibility is due in part to its running in the same activation group as OPM programs, namely, in the default activation group.
However, with this high compatibility comes the inability to have static
binding. Static binding refers to the ability to call procedures (in other
modules or service programs) and to use procedure pointers. The inability
to have static binding means that you cannot:
- Use the CALLB operation in your source
- Call a prototyped procedure
- Bind to other modules during program creation
Creating a program of the second type produces a program with ILE characteristics such as static binding. You can specify at program-creation time the activation group the program is to run in, and any modules for static binding. In addition, you can call procedures from your source.