Strategy 1: OPM-Compatible Application - IBM - RPG

Strategy 1 results in an ILE program that interacts well with OPM programs. It allows you to take advantage of RPG IV enhancements, but not all of the ILE enhancements. You may want such a program temporarily while you complete your migration to ILE


Use the following general approach to create such a program:

  1. Convert your source to RPG IV using the CVTRPGSRC command.Be sure to convert all /COPY members that are used by the source you are converting.
  2. Create a program object using the CRTBNDRPG command,specifying DFTACTGR (*YES).

Specifying DFTACTGRP(*YES) means that the program object will run only in the default activation group. (The default activation group is the activation group where all OPM programs are run.) As a result, the program object will interact well with OPM programs in the areas of override scoping, open scoping, and RCLRSC.

When you use this approach you cannot make use of ILE static binding. This means that you cannot code a bound procedure call in your source, nor can you use the BNDDIR or ACTGRP parameters on the CRTBNDRPG command when creating this program.

Example of OPM-Compatible Program
This shows the run-time view of a sample application where you might want an OPM- compatible program. The OPM application consisted of a CL program and two RPG programs. In this example, one of the RPG programs has been moved to ILE; the remaining programs are unchanged.

OPM-Compatible Application

OPM-Compatible Application

Effect of ILE

The following deals with the effects of ILE on the way your application handles:

Program call OPM programs behave as before. The system automatically creates the OPM default activation group when you start your job, and all OPM applications run in it. One program can call another program in the default activation group by using a dynamic call.

Data Storage for static data is created when the program is activated, and it exists until the program is deactivated. When the program ends (either normally or abnormally), the program’s storage is deleted. To clean up storage for a program that returns without ending, use the Reclaim Resource (RCLRSC) command.

File File processing is the same as in previous releases. Files are closed when the program end normally or abnormally.

Errors As in previous releases, the compiler handles errors within each program separately. The errors you see that originated within your program are the same as before. However, the errors are now communicated between programs by the ILE condition manager, so you may see different messages between programs. The messages may have new message IDs, so if your CL program monitors for a specific message ID, you may have to change that ID.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

IBM - RPG Topics