COBOL Manual for TNS and TNS/R Programs
Procedure Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
8-23
ROUNDED Phrase
In Example 8-9, assume that the records A and H obey all of the preceding rules. The
statement
MOVE CORRESPONDING A TO H
is equivalent to this series of MOVE statements:
MOVE B OF A TO B OF H
MOVE G OF F OF A TO G OF F OF H
ROUNDED Phrase
When the number of fraction digits in the result of an arithmetic operation exceeds the
number of fraction digits in the receiving item, the excess digits must be deleted by
either truncation or rounding. Also, when one or more low-order integer positions in a
receiving item are represented by P in the item’s PICTURE character-string,
equivalent digits in a result value must be deleted by truncation or rounding.
When the ROUNDED phrase is not specified, excess digits are deleted by truncation;
that is, the digits are simply discarded. If rounding is specified, the absolute value of
the retained portion of the value is increased by 1 whenever the most significant digit of
the excess is greater than or equal to 5.
In these examples, the caret (^) represents the assumed decimal point:
SIZE ERROR Phrase
The size error condition indicates a problem in computation, such as a loss of
precision. The SIZE ERROR and NOT SIZE ERROR phrases of the ADD, COMPUTE,
DIVIDE, MULTIPLY, and SUBTRACT statements enable you to test whether the
arithmetic operation caused the size error condition to arise. You cannot test for the
size error condition with an IF statement.
Example 8-9. CORRESPONDING Phrase
01 A 01 H
03 B 05 F
07 C 08 G
07 D 05 B
03 E 05 C
03 F 09 E
04 G 09 D
09 G
Actual Result PICTURE Character-String of Receiving Item Rounded Value
5^71489 9V999 5^715
7650^ 99PP 77
3^141592654 9V99 3^14