Loading...
Select Version
The MEAN function returns a numeric value that is the arithmetic mean (average) of its arguments.
The type of this function is numeric.
Format
FUNCTION
MEAN
({argument-1}...)
Argument
argument-1 must be class "numeric".
Returned values
The returned value is the arithmetic mean of the argument series.
The returned value is defined as the sum of the argument series divided by the number of arguments specified.
The error default value is 0.
See also: MIN, MAX, RANGE, MEDIAN, MIDRANGE, SUM
Example 9-25
... DATA DIVISION. WORKING-STORAGE SECTION. 01 R PIC 999V999. 01 RES PIC 999.999. PROCEDURE DIVISION. P1 SECTION. MAIN. COMPUTE R = FUNCTION MEAN (12 32 5 8 17 9). MOVE R TO RES. DISPLAY RES UPON T. STOP RUN.
Result: 013.833