COBOL/400 Language Help

Format 3 (ADD with CORRESPONDING)

Description
In Format 3, elementary data items within identifier-1 are added to and stored in the corresponding elementary items within identifier-2.

The composite of operands in an arithmetic statement can have a maximum length of 30 digits. In Format 3, the composite of operands is determined separately for each pair of corresponding data items.

Format 3 (ADD with CORRESPONDING)
 
->->---ADD--*-CORRESPONDING-*-identifier-1 TO identifier-2--*---------*--->
          *-CORR----------*                               *-ROUNDED-*
 
->----*----------------------------------------------*------------------->
     *--*----*---SIZE ERROR imperative-statement-1--*
        *-ON-*
 
->---*---------------------------------------------------*--------------->
    *-NOT---*----*---SIZE ERROR imperative-statement-2--*
            *-ON-*
 
-> --*---------*---------------------------------------------------------><-
    *-END-ADD-*

CORRESPONDING

The CORRESPONDING phrase (CORR) allows ADD, SUBTRACT, and MOVE operations to be performed on elementary data items of the same name if the group items to which they belong are specified. Both identifiers following the keyword CORRESPONDING must name group items.

identifier-1 or -2

In Format 3, identifiers must name a group item.


[ Top of Page | Previous Page | Next Page | Table of Contents ]