A type is a pattern containing all the characteristics of the data description and its subordinate data items. The principal characteristics of a type, which is identified by its type name, are the relative positions and lengths of its elementary items, which are defined in the type declaration, plus the BLANK WHEN ZERO clause, JUSTIFIED clause, PICTURE clause, SIGN clause, SYNCHRONIZED clause and USAGE clause which are specified for these elementary data items (for details on the clauses see the section "Data description entry").
A type is defined by specifying the TYPEDEF clause.
A type is referenced by a TYPE clause being specified in a data description. The typed data item thus defined has all the characteristics of the referenced type.
Group items can be weakly or strongly typed. A group item is strongly typed if:
either its data description contains a TYPE clause which refers to a type definition with the specification STRONG, or
it is subordinate to a group item containing a TYPE clause which refers to a type definition with the specification STRONG.
Two typed group items are of the same type if
either the data descriptions contain TYPE clauses which reference equivalent type description entries, or
data descriptions are subordinate group items in equivalent type description entries which start at the same position within the type description entries and are of the same length.
Two type description entries are regarded as equivalent if they have the same type name and for each elementary data item in one type description entry a corresponding elementary data item starting at the same position and of the same length exists in the other type description entry. Each pair of corresponding elementary data items must have the same BLANK WHEN ZERO clauses, JUSTIFIED clauses, PICTURE clauses, SIGN clauses, SYNCHRONIZED clauses and USAGE clauses.
The following exception applies here:
The point character in the associated PICTURE string is equivalent if the specification DECIMAL-POINT IS COMMA applies either for both or neither of the type description entries. The same applies for the comma character in the associated PICTURE string.
Weakly typed data descriptions
Weakly typed data descriptions take over the characteristics of their associated type description entries. These characteristics cannot be modified by the definitions of higher-ranking group items.
Weakly typed data descriptions can be used exactly like data descriptions without an associated type description.
Strongly typed data descriptions
Strongly typed data descriptions also take over the characteristics of their associated type descriptions. In addition, there are restrictions regarding their use in order to protect the integrity of the data.
Only group items, not data items, can be strongly typed.