In RPG III, when both renaming and initializing a field in an externally described data structure, you had to use two source lines, as shown for the field CHAR in Figure 237. The converted source also contains two source lines, as shown in Figure 238. This use of two source lines for a field will result in a compile-time error, as the field CHAR is defined twice. To correct this code you must combine the keywords of the field CHAR into a single line as shown in Figure 239, where the key fields INZ and EXTFLD have been combined and only one instance on the field CHAR is shown.
IDSONE E DSEXTREC
I CHARACTER CHAR
I I 'XYZ' CHAR
C CHAR DSPLY
C SETON LR D DSONE E DS EXTNAME(EXTREC)
D CHAR E EXTFLD(CHARACTER)
D CHAR E INZ('XYZ')
C CHAR DSPLY
C SETON LR D DSONE E DS EXTNAME(EXTREC)
D CHAR E EXTFLD(CHARACTER) INZ('XYZ')
C CHAR DSPLY
C SETON LR