Sign in

docs RPG Reference

Keyword differences between fixed form and free form definitions

Keyword differences between fixed form and free form definitions

Table 1. Free-form equivalents for keywords that are not supported in free-form definitions

KeywordFree-form equivalent
CLASSThe class information is specified as parameters of the OBJECT keyword.
DATFMTThe date format is specified as the parameter of the DATE keyword.
FROMFILEYou must use a fixed-form definition if you want to specify the FROMFILE keyword.
PACKEVENThe PACKEVEN keyword is related to the use of from-and-to positions which are not supported for a free-form subfield definition.
PROCPTRThe procedure pointer data type is specified as POINTER(*PROC).
TIMFMTThe time format is specified as the parameter of the TIME keyword.
TOFILEYou must use a fixed-form definition if you want to specify the TOFILE keyword.
VARYINGVariable length fields are defined using the VARCHAR, VARGRAPH, and VARUCS2 keywords.

Table 2. Keyword differences between free-form and fixed-form definitions

KeywordDifference
DTAARASee Free-form DTAARA keyword for a data structure and Free-form DTAARA keyword for a field or subfield.
EXPORTIn a free-form definition, the external name can be specified using *DCLCASE.
EXTFLDIn a free-form definition, the external field name must be specified as a character literal or a previously defined named constant representing a character literal.
EXTNAMEIn a free-form definition, the external file and external record format must be specified as character literals or previously-defined named constants representing a character literals.
EXTPROCIn a free-form definition, the external name can be specified using *DCLCASE.
IMPORTIn a free-form definition, the external name can be specified using *DCLCASE.
LIKEIn a free-form definition, the length adjustment is specified as the second parameter of the LIKE keyword.
OVERLAYIn a free-form definition, the parameter of the OVERLAY keyword cannot be the name of the data structure. To explicitly specify the starting position of a subfield within the data structure, use the POS keyword.