CORRESPONDING Option

The CORRESPONDING option of the MOVE, ADD, and SUBTRACT verbs allows the programmer to specify group items as operands in order to use their corresponding subordinate data items. All identifiers in a CORRESPONDING phrase must refer to group items.

The operation specified by the statement acts on each pair of corresponding items in the specified group items. If two or more source data items have the same name, or two or more destination items have the same name, the operation may be performed more than once on some items.

Data items are considered to correspond if they match the following rules. In these rules, ident-1 and ident-2 refer to the two group items specified in the CORRESPONDING phrase.

  1. The data items in ident-1 and ident-2 must have the same data-name (which may not be FILLER).
  2. They must have the same qualifiers up to but not including ident-1 and ident-2.
  3. At least one of the data items must be elementary, and the resulting operation must be legal under the rules of the statement being executed. A violation to this rule causes a compile-time error; it does not exclude the item from the operation.
  4. In ADD or SUBTRACT statements, both of the data items must refer to an elementary numeric data item.
  5. Data items subordinate to a REDEFINES, RENAMES, OCCURS, or USAGE IS INDEX clause are ignored.