Conventions used in the descriptions of data types
For each elementary data type, this chapter gives a description of its usage, in a form that is independent of the programming language. This is followed by a typical declarations in the ILE version of the RPG programming language. The definitions of elementary data types are included here to provide consistency. RPG uses 'D' specifications where working fields can be declared using whatever attributes we need. We can, however, do this in the calculation specifications where the field is used.
To use the elementary data types, you create:
- A /COPY member containing all the data types, or
- An external data structure (PF) containing all the data types. You then need to specify your working fields with attributes 'LIKE' the appropriate data type field.
The benefits of the second option are that the definitions can be used as a 'FIELD REFERENCE FILE' for other AS/400 objects. If an MQ data type definition changes, it is a relatively simple matter to recreate these objects.