COBOL/400 Language Help

Format 1 (ADD)

Description
In Format 1, all identifiers or literals preceding the keyword TO are added together; the resulting sum is added to and stored in identifier-2. This process is repeated for each successive occurrence of identifier-2, in the left-to-right order in which identifier-2 is specified.

The composite of operands in an arithmetic statement can have a maximum length of 30 digits. In Format 1, the composite of operands is determined by using all of the operands in a given statement.

Format 1 (ADD)
 
          *----------------*      *-------------------------*
          V                +      V                         +
->->---ADD--*--identifier-1--*--TO--identifier-2--*-----------*----------->
          *--literal-1-----*                    *--ROUNDED--*
 
->----*----------------------------------------------*------------------->
     *--*----*---SIZE ERROR imperative-statement-1--*
        *-ON-*
 
->---*---------------------------------------------------*--------------->
    *-NOT---*----*---SIZE ERROR imperative-statement-2--*
            *-ON-*
 
-> --*---------*---------------------------------------------------------><-
    *-END-ADD-*

identifier-1 or -2

In Format 1, identifiers must name elementary numeric items.

literal-1

Literal-1 must be a numeric literal.


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