COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Usage Considerations:
• Mathematics
The values of all the subtrahend s are totaled. That sum is subtracted from minuend, and
the result of this subtraction is then stored after rounding, if ROUNDED was specified as the
new value of each result. For example, the statement
SUBTRACT A B C FROM D GIVING E
means store D - (A + B + C) in E.
• Changing Operand Values
The SUBTRACT GIVING statement does not change the value of any subtrahend or the minuend,
unless one is also named as a result.
• Arithmetic Operations
See Arithmetic Operations (page 257) for information on data conversion and alignment,
intermediate results, multiple results (and subscript evaluation), and incompatible data.
• Precision
For any series of items involved in a subtraction, when their decimal points are aligned, the
composite picture must involve not more than 18 digits of representation, or a size error
condition can result (which can cause a run unit to terminate abnormally with an arithmetic
overflow condition). For information on precision of subtraction, see ADD and SUBTRACT
Statements (page 262).
• ROUNDED and SIZE ERROR Phrases
See ROUNDED Phrase (page 244) and SIZE ERROR Phrase (page 244) for information on these
phrases.
SUBTRACT CORRESPONDING
SUBTRACT CORRESPONDING subtracts elements of one data structure from corresponding elements
of another data structure.
CAUTION: SUBTRACT CORRESPONDING is not recommended, because minor changes to one
data structure can change the correspondence between its elements and those of the other data
structure, and this is difficult to detect.
470 Procedure Division Verbs










