COBOL Manual for TNS and TNS/R Programs

Intrinsic Functions
HP COBOL Manual for TNS and TNS/R Programs522555-006
14-58
SUM Function
SUM Function
SUM is a function that returns the sum of its arguments. Its type depends on the type
of its arguments, as this table shows:
argument
is an integer or numeric argument.
argument can be an array; for example,
FUNCTION SUM (ARRAY1(ALL))
returns the sum of the elements of the array ARRAY1.
The returned value is
where n is the number of arguments.
Argument Type Function Type
Integer Integer
Numeric (some can be integer) Numeric
( )
SUMFUNCTION argument
VST463.vsd
argument
i
i
1=
n