Sign in

docs RPG Reference

Summary According to Definition Specification Type

Summary According to Definition Specification Type

Table 1 lists the required and allowed entries for each definition specification type.

Table 2 and Table 3 list the keywords allowed for each definition specification type.

In each of these tables, an R indicates that an entry in these positions is required and an A indicates that an entry in these positions is allowed.

Table 1. Required/Allowed Entries for each Definition Specification Type

TypePos. 7-21 NamePos. 22 ExternalPos. 23 DS TypePos. 24-25 Defn. TypePos. 26-32 FromPos. 33-39 To / LengthPos. 40 Data- typePos. 41-42 Decimal Pos.Pos. 44-80 Key- words
Data StructureAAARAA
Data Structure SubfieldAAAAAA
External SubfieldARA
Standalone FieldRRAAAA
Named ConstantRRR
PrototypeRRAAAA
Prototype ParameterAAAAA
Procedure InterfaceARAAAA
Procedure Interface ParameterRAAAA

Table 2. Data Structure, Standalone Fields, and Named Constants Keywords

KeywordData StructureData Structure SubfieldExternal SubfieldStandalone FieldNamed Constant
ALIGNA
ALTAAA
ALTSEQAAAA
ASCENDAAA
BASEDAA
BINDEC7AA
CHAR7AA
CCSIDA8AA
CLASS6A
CONST1R
CTDATA2AAA
DATE7AA
DATFMT6AA
DESCENDAAA
DIMAAAA
DTAARA2AAA
EXPORT2AA
EXT5A
EXTFLDA
EXTFMTAAA
EXTNAME4A
FLOAT7AA
FROMFILE2AAA
GRAPH7AA
IMPORT2AA
IND7AA
INT7AA
INZAAAA
LENAAA
LIKEAA
LIKEDS5AA
LIKERECAA
NOOPTAA
NULLINDA4AA
OBJECT7AA
OCCURSA
OVERLAYA
PACKED7AA
PACKEVEN6A
PERRCDAAA
POINTER7AA
POS5A
PREFIX4A
PROCPTR6AA
PSDSA
QUALIFIEDA
STATIC3AA
TEMPLATEAA
TIME7AA
TIMESTAMP7AA
TIMFMT6AA
TOFILE2AAA
UCS27AA
UNS7AA
VARCHAR7AA
VARGRAPH7AA
VARUCS27AA
VARYING6AA
ZONED7AA
Note: 1. When defining a named constant, the keyword is optional, but the parameter to the keyword is required. For example, to assign a named constant the value ‘10’, you could specify either CONST(‘10’) or ‘10’. 2. This keyword applies only to global definitions. 3. This keyword applies only to local definitions. 4. This keyword applies only to externally described data structures. 5. This keyword applies only to program-described data structures. 6. This keyword applies only to fixed-form definitions. 7. This keyword applies only to free-form definitions. 8. This keyword applies only to externally-described data structures and data structures defined with the EXTNAME or LIKEREC keyword. Furthermore, *NULL cannot not specified as an extract type for the EXTNAME or LIKEREC keyword.

Table 3. Prototype, Procedure Interface, and Parameter Keywords

KeywordPrototype (PR)Procedure Interface (PI)PR or PI Parameter
ALTSEQAAA
ASCENDA
BINDEC1AAA
CCSIDAAA
CHAR1AAA
CLASS2AAA
CONSTA
DATE1AAA
DATFMT2AAA
DESCENDA
DIMAAA
EXTPGMAA
EXTPROCAA
FLOAT1AAA
GRAPH1AAA
IND1AAA
INT1AAA
LENAAA
LIKEAAA
LIKEFILEA
LIKEDSAAA
LIKERECAAA
NOOPTA
NULLINDA
OBJECT1AAA
OPDESCAA
OPTIONSA
PACKED1AAA
POINTER1AAA
PROCPTR2AAA
RTNPARMAA
STATICAA
TIME1AAA
TIMESTAMP1AAA
TIMFMT2AAA
UCS21AAA
UNS1AAA
VALUEA
VARCHAR1AAA
UNS1AAA
VARCHAR1AAA
VARGRAPH1AAA
VARUCS21AAA
VARYING2AAA
ZONED1AAA
Note: 1. This keyword applies only to free-form definitions. 2. This keyword applies only to fixed-form definitions.