Supported RPG Features

The classic C-spec packs the operation into a five-column field, so operations whose RPG IV names are longer carry truncated spellings. Each is accepted as an exact synonym of the operation it truncates:

RPG II/III RPG IV Notes
SELEC SELECT Closed by END or ENDSL; both spellings work.
WHEQ WHNE WHLT WHLE WHGT WHGE WHENEQWHENGE Comparison branch under SELEC. Takes ANDxx / ORxx continuation lines exactly as WHENxx does.
RETRN RETURN
UPDAT UPDATE
DELET DELETE
DEFN DEFINE Both *LIKE and the data-area form.
OCUR OCCUR Factor 1 sets the current occurrence; the result field receives it.

The two spellings may be mixed freely in one program, which is what partially modernised source looks like.

*NAMVAR is the classic spelling of *DTAARA. RPG II/III writes the data-area association as *NAMVAR DEFN, RPG IV as *DTAARA DEFINE; both bind the result field to the named data area, and Factor 2 left blank defaults the data-area name to the field name.

     C           *NAMVAR   DEFN MYDTA     DA      10
     C                     IN        DA

Because RPG II/III has no D-specs, a DEFN that introduces a new field takes that field's attributes from its own field-length and decimal-position columns, following the same rule as implicit variable declaration.

Data structures on Input specifications are supported. RPG III declares data structures on I-specs (the dialect has no D-specs): a header line with DS in columns 19 - 20, followed by subfield lines with FROM/TO positions in columns 44 - 51, decimal positions in column 52, and the field name in columns 53 - 58. OCCURS (columns 44 - 47 on the header) and externally described (E in column 19) forms are both accepted. D-spec data structures are also accepted in a classic-layout source.