Context-Sensitive Problems

In RPG III, there are occasions when it is impossible to determine the type of specifications in a /COPY member without the context of the surrounding specifications of the primary source member. There are two instances of this problem:

In the above two instances, a data structure is assumed and definition specifications are produced. A block of comments containing the input specification code is also produced. For example, the Conversion Aid will convert the source in Figure 1 to the code shown in Figure 3. If Input specification code is required, delete the definition specifications and blank out the asterisks from the corresponding Input specifications.

Figure 3. RPG IV source after converting source with input fields only
     D* If the RPG III source member contains only the source
     D* statements describing fields FIELD1 and FIELD2 below, the
     D* Conversion Aid is unsure how to convert them.  These
     D* statements may be data structure fields (which are converted
     D* to definition specifications) or program-described file
     D* fields (which are converted to input specifications).
     D FIELD1                  1      3
     D FIELD2                  4      6
     I*                                 1    3  FIELD1
     I*                                 4    6  FIELD2

Remember that you have two ways of correcting these types of problems. Either use the EXPCPY(*YES) option of the CVTRPGSRC command, or manually correct the code after conversion.


Feedback