SUBTRACT-CORRESPONDING

Short Reference

Syntax

SUBTRACT-CORRESPONDING struc1 FROM struc2.

Effect

This statement is not allowed in classes and subtracts structures by component. For struc1 and struc2, structures must be specified. For all identically named components in struc1 and struc2, the component in struc1 is subtracted in pairs from the component in struc2 and assigned to the relevant component of struc2.

The name comparison is executed as by the assignment MOVE-CORRESPONDING. For each identically named component pair comp, the statement

SUBTRACT struc1-comp FROM struc2-comp.

is executed internally, although, if required, the associated conversions are also executed.

Note

This statement is not allowed in classes. The statement is prone to errors because you cannot easily ensure if the corresponding components have the data type and content required for a numeric operation in complex structures.

Exceptions

Catchable Exceptions

CX_SY_ARITHMETIC_OVERFLOW

CX_SY_CONVERSION_OVERFLOW

Non-Catchable Exceptions