Weakly typed data descriptions relate to a type declaration which does not contain the STRONG phrase, and they are not subordinate to such type declarations. Weakly typed data descriptions can be either group items or elementary items.
Their data structure is not always protected in the manner described as weakly typed data descriptions can be used like practically any untyped data description. The type declaration could be regarded as an abbreviation for a number of data descriptions.
The following example illustrates how the TYPEDEF clause is used to define a type, and the TYPE clause to use a type:
Example 12-27
01 Employee TYPEDEF. *> defines type name Employee 02 name PIC X(30). *> with this description 02 personnel-number PIC 9(8). 01 Department. 02 Dept-Name PIC X(16). 02 Dept-Head TYPE Employee. *> uses type name Employee 02 Dept-Deputy TYPE Employee. 02 Dept-Office TYPE Employee.
This results in a record with the description:
01 Department. 02 Dept-Name PIC X(16). 02 Dept-Head. 03 name PIC X(30). 03 personnel-number PIC 9(8). 02 Dept-Deputy. 03 name PIC X(30). 03 personnel-number PIC 9(8). 02 Dept-Offic. 03 name PIC X(30). 03 personnel-number PIC 9(8).
The expansion of a type can create hierarchies with a depth of more than 49 levels which can otherwise at most be directly written in a data description.