Classes and categories of group items
Enterprise COBOL has two types of groups: alphanumeric groups and national groups.
Groups that do not specify a GROUP-USAGE clause are alphanumeric groups. An alphanumeric group has class and category alphanumeric and is treated as though its usage were DISPLAY, regardless of the representation of the elementary data items that are contained within the group. In many operations, such as moves and compares, alphanumeric groups are treated as though they were elementary items of category alphanumeric, except that no editing or conversion of data representation takes place. In other operations, such as MOVE CORRESPONDING and ADD CORRESPONDING, the subordinate data items are processed as separate elementary items.
National groups are defined by a GROUP-USAGE clause with the NATIONAL phrase at the group level. All subordinate data items must be explicitly or implicitly described with usage NATIONAL, and subordinate groups must be explicitly or implicitly described with GROUP-USAGE NATIONAL.
Unless stated otherwise, a national group item is processed exactly as though it were an elementary data item of usage national, class and category national, described with PICTURE N(m), where m is the length of the group in national character positions. Because national groups contain only national characters, data is converted as necessary for moves and compares. The compiler ensures proper truncation and padding. In other operations, such as MOVE CORRESPONDING and ADD CORRESPONDING, the subordinate data items are processed as separate elementary items. See GROUP-USAGE clause for details.
The table below summarizes the classes and categories of group items.
Group description | Class of group | Category of group | USAGE of elementary items within a group | USAGE of a group |
---|---|---|---|---|
Without a GROUP-USAGE clause | Alphanumeric | Alphanumeric (even though the elementary items in the group can have any category) | Any | Treated as DISPLAY when usage is relevant |
With explicit or implicit GROUP-USAGE clause | National | National | NATIONAL | NATIONAL |