IBM AS/400 manual Context-Sensitive Problems, Resolving Conversion Problems

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 424
Image 424

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, incl

/COPY members in each source member reduces the maintainability of application.

2. Manually correct the code

after

conversion using the information in

RPG compiler listing andILE theRPG

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 Addres

 

extension specification are changed to keywords

(RAFDATA, FORMLEN,

and

 

FORMOFL) on the file description specification.

If the content of a

 

member

contains

only

the

line

counter

specification

and/or

the

 

Record

 

File of the extension specification but not the corresponding file

 

specification,

the

Conversion

Aid

does

not

 

know

where

to

insert

the

¹

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

subfiel

 

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

ar

 

same source member (that is, one or

both

is

in a /COPY member), th

 

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

lo

 

data may be affected. To overcome this problem, compile-time array

 

changed to the new **CTDATA format if at least

one compile-time array

 

merged.

However, if the arrays and

 

the

 

data

do

 

not

reside

in

th

 

file (that is, one or both is in a

COPY

member)

the

naming

of comp

 

records

using

the

**CTDATA

format

cannot

proceed

properly.

 

 

 

 

Context-Sensitive Problems

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

¹ 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, t￿he

I* Conversion Aid is unsure how to convert

them.

These

I* statements may be data structure fields

(which

are

conve￿rted

I* to definition specifications) or program-described

fil￿e

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

Page 424
Image 424
IBM AS/400 manual Context-Sensitive Problems, Resolving Conversion Problems