COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

Example 218 SUM Function
Code:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 NUMERIC-ARRAY
05 PICTURE 9V99 VALUE 0.05.
05 PICTURE 9V99 VALUE 1.15.
05 PICTURE 9V99 VALUE 2.50.
05 PICTURE 9V99 VALUE 3.75.
05 PICTURE 9V99 VALUE 4.55.
01 NUM-ARRAY REDEFINES NUMERIC-ARRAY.
05 NUM OCCURS 5 TIMES PICTURE 9V99.
PROCEDURE DIVISION.
DISPLAY FUNCTION SUM (NUM(ALL))
DISPLAY FUNCTION SUM (9 2 5 3)
DISPLAY FUNCTION SUM (1.5 3.6 7.8 4.9)
Output:
012.00
19
17.8
TAN Function
TAN, a numeric function, returns a value that approximates the tangent of the angle or arc (in
radians) specified by its argument.
argument
is a numeric argument.
The returned value approximates the tangent of the value of argument. It is a floating-point number
with no implied decimal point, precise to approximately 14 digits.
692 Intrinsic Functions