Data type descriptions on IBM i
This collection of topics provides descriptions of data types used in IBM® i programming.
Conventions used in the description of data types
For each elementary data type, this information gives a description of its usage, in a form that is independent of the programming language. This is followed by 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 you 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 IBM i objects. If an IBM MQ data type definition changes, it is a relatively simple matter to re-create these objects.