The ADD statement causes two or more numeric operands to be summed and the result to be stored.
Format 3:Add Corresponding
In Format 1, the values of the operands preceding the word TO are added together; that sum is then added to the current value of each data item referenced by identifier-2 storing the result immediately into that data item.
In Format 2, the values of the operands preceding the word GIVING are added together; that sum is then stored as the new value of each data item referenced by identifier-3.
In Formats 1 and 2, each identifier must refer to an elementary numeric item, except that in Format 2, each identifier following the word GIVING may refer to either an elementary numeric item or an elementary numeric edited item.
In Format 3, data items in identifier-1 are added to and stored in the corresponding data items in identifier-2.
In Format 3, each identifier must refer to a group item.
Each literal must be a numeric literal.
Additional rules and explanations regarding features of the ADD statement that are common to other arithmetic statements can be found in the discussion of common rules.See in particular the discussions of the ROUNDED phrase, the size error condition, overlapping operands, modes of operation, composite size, and incompatible data.
If the CORRESPONDING phrase is used, selected items within identifier-1 are added to, and the result stored in, the corresponding items in identifier-2.
For the ADD statement with the CORRESPONDING phrase:
The rules that govern the selection of eligible subordinate data item pairs are as follows:
If any of the individual operations produces a size error condition, imperative-statement-1 in the ON SIZE ERROR phrase is not executed until all of the individual additions are completed. CORR and CORRESPONDING are synonymous.
ADD Statement Examples
COBOL Related Interview Questions
|VSAM Interview Questions||IBM - VSAM Interview Questions|
|IBM-CICS Interview Questions||JCL Interview Questions|
|IBM DB2 Interview Questions||IBM-JCL Interview Questions|
|DB2 Using SQL Interview Questions||IBM-JCL&VSAM Interview Questions|
|IBM Mainframe Interview Questions||COBOL, CICS, JCL, VSAM, DB2 Interview Questions|
|DB2 SQL Programming Interview Questions||IMS/DB Interview Questions|
|Mainframe DB2 Interview Questions|
Procedure Division Statements
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.