COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
discount-rate
is a numeric argument whose value is greater than -1.
period-end-amount
is a numeric argument.
period-end-amount can be an array; for example,
FUNCTION PRESENT-VALUE (DISCOUNT-RATE ARRAY1(ALL))
uses the elements of the array ARRAY1 as a series of numeric arguments.
The returned value is approximately
where n is the number of period-end-amount s.
Example 210 PRESENT-VALUE 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 N OCCURS 5 TIMES PICTURE 9V99.
01 A PICTURE S99V99.
PROCEDURE DIVISION.
MOVE FUNCTION PRESENT-VALUE (0 NUM(ALL) TO A) TO A
DISPLAY A.
MOVE FUNCTION PRESENT-VALUE (1 NUM(ALL) TO A) TO A
DISPLAY A.
MOVE FUNCTION PRESENT-VALUE (2.5 NUM(ALL) TO A) TO A
DISPLAY A.
MOVE FUNCTION PRESENT-VALUE (0 3) TO A
DISPLAY A.
MOVE FUNCTION PRESENT-VALUE (1.5 3.6 7.8 4.9) TO A
DISPLAY A.
Output:
12.00
01.00
00.20
03.00
03.00
RANDOM Function
RANDOM, a numeric function, returns a pseudorandom number from a rectangular distribution.
RANDOM Function 685










