Using national groups as group items

In some cases when you use a national group, it is handled with group semantics; that is, the elementary items in the group are recognized or processed.

About this task

In the following example, an INITIALIZE statement that acts upon national group item Group-OneN causes the value 15 in national characters to be moved to only the numeric items in the group:


01  Group-OneN    Group-Usage National.
    05  Trans-codeN     Pic N   Value "A".
    05  Part-numberN    Pic NN  Value "XX".
    05  Trans-quanN     Pic 99  Value 10.
    . . .
    Initialize Group-OneN Replacing Numeric Data By 15

Because only Trans-quanN in Group-OneN above is numeric, only Trans-quanN receives the value 15. The other subordinate items are unchanged.

The table below summarizes the cases where national groups are processed with group semantics.

Table 1. National group items that are processed with group semantics
Language feature Uses of national group items Comment
CORRESPONDING phrase of the ADD, SUBTRACT, or MOVE statement Specify a national group item for processing as a group in accordance with the rules of the CORRESPONDING phrase. Elementary items within the national group are processed like elementary items that have USAGE NATIONAL within an alphanumeric group.
Host variable in EXEC SQL statement Specify a national group item as a host variable. The national group item is in effect shorthand for the set of host variables that are subordinate to the group item.
INITIALIZE statement Specify a national group for processing as a group in accordance with the rules of the INITIALIZE statement. Elementary items within the national group are initialized like elementary items that have USAGE NATIONAL within an alphanumeric group.
Name qualification Use the name of a national group item to qualify the names of elementary data items and of subordinate group items in the national group. Follow the same rules for qualification as for an alphanumeric group.
THROUGH phrase of the RENAMES clause To specify a national group item in the THROUGH phrase, use the same rules as for an alphanumeric group item. The result is an alphanumeric group item.
FROM phrase of the XML GENERATE statement Specify a national group item in the FROM phrase for processing as a group in accordance with the rules of the XML GENERATE statement. Elementary items within the national group are processed like elementary items that have USAGE NATIONAL within an alphanumeric group.

Related references  
Qualification (Enterprise COBOL for z/OS® Language Reference)  
RENAMES clause (Enterprise COBOL for z/OS Language Reference)