Resolving Conversion Problems
Resolving Conversion Problems
Conversion problems may arise for one or more of the following reasons:
The RPG III source has compilation errors
Certain features of the RPG III language are not supported by RPG IV
One or more /COPY compiler directives exists in the RPG III source
Use of externally described data structures
Behavioral differences between the OPM and ILE run time
Each of these areas is discussed in the sections which follow.
Compilation Errors in Existing RPG III Code
The Conversion Aid assumes that you are attempting to convert a valid RPG III
program, that is, a program with no compilation errors. If this is not the case, then
unpredictable results may occur during conversion. If you believe your program
contains compilation errors, compile it first using the RPG III compiler and correct
any errors before performing the conversion.
Unsupported RPG III Features
A few features of the RPG III language are
not
supported in RPG IV. The most
notable of these are:
The auto report function
The FREE operation code
The DEBUG operation code
Since the auto report function is not supported, the Conversion Aid will automat-
ically expand these programs (that is, call auto report) prior to performing the con-
version if the type is RPT or RPT38.
You must replace the FREE or DEBUG operation code with equivalent logic either
before or after conversion.
If you specify the CVTRPT(*YES) option on the CVTRPGSRC command, you will
receive a conversion report that identifies most of these types of problems.
For further information on converting auto report members, see “Converting Auto
Report Source Members” on page 389. For further information on differences
between RPG III and RPG IV, see Appendix A, “Behavioral Differences Between
OPM RPG/400 and ILE RPG for AS/400” on page 373.
Use of the /COPY Compiler Directive
In some cases, errors will not be found until you actually compile the converted
RPG IV source. Conversion errors of this type are usually related to the use of the
/COPY compiler directive. These errors fall into two categories: merging problems
and context-sensitive problems. Following is a discussion of why these problems
occur and how you might resolve them.
398 ILE RPG for AS/400 Programmer's Guide