Supported RPG Features

In RPG II and RPG III programs, variables do not require D-spec declarations. A variable is implicitly declared the first time it appears as the result field of a C-spec operation (Z-ADD, ADD, MULT, DIV, etc.) with a non-blank field-length and optional decimal positions. Those two entries sit at different columns in the two layouts - field length 64-68 and decimals 69-70 in RPG IV, field length 49-51 and decimals 52 in the classic RPG II/III map - and each source is read at the columns its detected layout uses. The examples below are written in the RPG IV layout.

     C                     Z-ADD1000.00   PRINC     9 2
     C                     Z-ADD5.5       RATE      5 2
     C                     Z-ADD10        YEARS     3 0

In the example above, PRINC is declared as PACKED(9:2), RATE as PACKED(5:2), and YEARS as PACKED(3:0). No D-specs are needed.

If a variable is explicitly declared via a D-spec and also appears as a C-spec result field with field-length, the D-spec declaration takes precedence and no conflict is reported.