IBM AS/400 Frozen Dessert Maker User Manual


 
Resolving Conversion Problems
There are two methods of correcting this type of problem:
1. Use the EXPCPY(*YES) option of the CVTRPGSRC command to include all
/COPY members in the converted RPG IV source member.
This approach is easy and will work most of the time. However, including the
/COPY members in each source member reduces the maintainability of your
application.
2. Manually correct the code after conversion using the information in the ILE
RPG compiler listing and the
ILE RPG for AS/400 Reference
.
Other examples of this type of problem include:
Line Specifications and Record Address Files
In RPG III the line counter specification and the Record Address File of the
extension specification are changed to keywords (RAFDATA, FORMLEN, and
FORMOFL) on the file description specification. If the content of a /COPY
member contains only the line counter specification and/or the Record Address
File of the extension specification but not the corresponding file description
specification, the Conversion Aid does not know where to insert the keywords.
Extension Specification Arrays and Data Structure Subfields
As mentioned in “Example of Source Conversion” on page 390, you are not
allowed to define a standalone array and a data structure subfield with the
same name in RPG IV. Therefore, as shown in the example TEST1 (
Figure 195 on page 392), the Conversion Aid must merge these two defi-
nitions. However, if the array and the data structure subfield are not in the
same source member (that is, one or both is in a /COPY member), this merging
cannot take place and a compile-time error will result.
Merged compile-time array and compile-time data (**) records
As shown in the example TEST1 ( Figure 195 on page 392), if compile-time
arrays are merged with data structure subfield definitions, the loading of array
data may be affected. To overcome this problem, compile-time array data are
changed to the new **CTDATA format if at least one compile-time array is
merged. However, if the arrays and the data do not reside in the same source
file (that is, one or both is in a COPY member) the naming of compile-time data
records using the **CTDATA format cannot proceed properly.
Context-Sensitive Problems
In RPG III, there are occasions when it is impossible to determine the type of spec-
ifications in a /COPY member without the context of the surrounding specifications
of the primary source member. There are two instances of this problem:
In data structure subfields or program-described file fields
I* If the RPG III source member contains only the source
I* statements describing fields FIELD1 and FIELD2 below, the
I* Conversion Aid is unsure how to convert them. These
I* statements may be data structure fields (which are converted
I* to definition specifications) or program-described file
I* fields (which are converted to input specifications).
I 1 3 FIELD1
I 4 6 FIELD2
Figure 203. RPG III /COPY file with input fields only
400 ILE RPG for AS/400 Programmer's Guide