Am reviewing existing programs that calculate interest rates. Does Vision Results calculate negative interest rate values?
Is a sample available?
z/OS any level
Vision: Results 6.0
Vision: Excel 6.0
VISION:Results is commonly used with VISION:Excel to calculate annuity values, present values, and future values. The product provides COPY books and routines for specifically that type of calculation.
The following is a typical VISION:Results/VISION:Excel annuity job and the report it generates.
Sample Program:
Highlighted is the 6.0 percent interest that is being used for this exercise:
OPTION STRUCTURED2
FILE SYSIN CARDS DUMMY
WORKAREA
BLANK_ 45 VALUE ' '
TITLE0 45 VALUE 'ANNUITY VALUE SUBROUTINES'
TITLE0_ 45 VALUE '*************************'
SIDE_T1 30 VALUE 'INPUT VALUES '
SIDE_T2 30 VALUE 'OUTPUT VALUE '
SIDE_1 30 VALUE 'FLAG VALUE '
SIDE_2 30 VALUE 'NUMBER OF PERIODS '
SIDE_3 30 VALUE 'RATE OF INTEREST (%) '
SIDE_4 30 VALUE 'ANNUITY PAYMENT ($) '
SIDE_5 33 VALUE 'PRESENT VALUE OF ANNUITY ($)'
SIDE_6 33 VALUE 'FUTURE VALUE OF ANNUITY ($)'
SIDE_7 33 VALUE 'PRESENT VALUE OF ANNUITY DUE ($)'
SIDE_8 33 VALUE 'FUTURE VALUE OF ANNUITY DUE ($)'
SIDE_ERROR 33 VALUE 'ERROR CHECK VALUE OF FLAG '
WORKAREA
XVALUE 16 PD 4 A VALUE 0.0000
COPY ANUVALUE #1=2 #2=5 #3=6.0000 #4=1000.0000 #5=XVALUE
LIST BLANK AT 3 WITH 1 AFTER
LIST TITLE0 AT 3
LIST TITLE0_ AT 3 WITH 2 AFTER
LIST SIDE_T1 AT 3 WITH 1 AFTER
LIST SIDE_1 AT 5 DYL01FL AT 57
LIST SIDE_2 AT 5 DYL01NP AT 57
LIST SIDE_3 AT 5 DYL01RI AT 56
LIST SIDE_4 AT 5 DYL01AP AT 60
LIST SIDE_T2 AT 3 WITH 1 AFTER
CASE DYL01FL
WHEN EQ 1
LIST SIDE_5 AT 5 XVALUE AT 40
WHEN EQ 2
LIST SIDE_6 AT 5 XVALUE AT 39
WHEN EQ 3
LIST SIDE_7 AT 5 XVALUE AT 40
WHEN EQ 4
LIST SIDE_8 AT 5 XVALUE AT 40
ELSE
LIST SIDE_ERROR AT 5 XVALUE AT 40
ENDCASE
STOP
ANNUITY VALUE SUBROUTINES
*************************
INPUT VALUES
FLAG VALUE 2
NUMBER OF PERIODS 5
RATE OF INTEREST (%) 6.0000
ANNUITY PAYMENT ($) 1,000.0000
OUTPUT VALUE
FUTURE VALUE OF ANNUITY ($) 5,637.0930
Here is the same VISION:Results annuity job and its report but with a negative 0.25 percent interest rate. Please note that when a negative number is used as one of the values in a COPY statement, it MUST be in quotes!
OPTION STRUCTURED2
FILE SYSIN CARDS DUMMY
WORKAREA
BLANK_ 45 VALUE ' '
TITLE0 45 VALUE 'ANNUITY VALUE SUBROUTINES'
TITLE0_ 45 VALUE '*************************'
SIDE_T1 30 VALUE 'INPUT VALUES '
SIDE_T2 30 VALUE 'OUTPUT VALUE '
SIDE_1 30 VALUE 'FLAG VALUE '
SIDE_2 30 VALUE 'NUMBER OF PERIODS '
SIDE_3 30 VALUE 'RATE OF INTEREST (%) '
SIDE_4 30 VALUE 'ANNUITY PAYMENT ($) '
SIDE_5 33 VALUE 'PRESENT VALUE OF ANNUITY ($)'
SIDE_6 33 VALUE 'FUTURE VALUE OF ANNUITY ($)'
SIDE_7 33 VALUE 'PRESENT VALUE OF ANNUITY DUE ($)'
SIDE_8 33 VALUE 'FUTURE VALUE OF ANNUITY DUE ($)'
SIDE_ERROR 33 VALUE 'ERROR CHECK VALUE OF FLAG '
WORKAREA
XVALUE 16 PD 4 A VALUE 0.0000
COPY ANUVALUE #1=2 #2=5 #3='-.2500' #4=1000.0000 #5=XVALUE
LIST BLANK AT 3 WITH 1 AFTER
LIST TITLE0 AT 3
LIST TITLE0_ AT 3 WITH 2 AFTER
LIST SIDE_T1 AT 3 WITH 1 AFTER
LIST SIDE_1 AT 5 DYL01FL AT 57
LIST SIDE_2 AT 5 DYL01NP AT 57
LIST SIDE_3 AT 5 DYL01RI AT 56
LIST SIDE_4 AT 5 DYL01AP AT 60
LIST SIDE_T2 AT 3 WITH 1 AFTER
CASE DYL01FL
WHEN EQ 1
LIST SIDE_5 AT 5 XVALUE AT 40
WHEN EQ 2
LIST SIDE_6 AT 5 XVALUE AT 39
WHEN EQ 3
LIST SIDE_7 AT 5 XVALUE AT 40
WHEN EQ 4
LIST SIDE_8 AT 5 XVALUE AT 40
ELSE
LIST SIDE_ERROR AT 5 XVALUE AT 40
ENDCASE
STOP
ANNUITY VALUE SUBROUTINES
*************************
INPUT VALUES
FLAG VALUE 2
NUMBER OF PERIODS 5
RATE OF INTEREST (%) .2500-
VISION:Results with VISION:Excel can also calculate the result being a negative interest rate.
Provided is a routine to calculate the interest rate based on the present value and what the future value will be and an interest value job where the interest rate is calculated based on the present value of 500 and the future value being 600.
FILE SYSIN CARDS DUMMY
WORKAREA
BLANK_ 45 VALUE ' '
TITLE0 45 VALUE 'RATE OF INTEREST SUBROUTINE'
TITLE0_ 45 VALUE '***************************'
SIDE_T1 30 VALUE 'INPUT VALUES '
SIDE_T2 30 VALUE 'OUTPUT VALUE '
SIDE_1 30 VALUE 'NUMBER OF PERIODS '
SIDE_4 30 VALUE 'RATE OF INTEREST (%) '
SIDE_2 30 VALUE 'PRESENT VALUE ($) '
SIDE_3 30 VALUE 'FUTURE VALUE ($) '
WORKAREA
XINTVAL 16 PD 4 A VALUE 0.0000
COPY INTVALUE #1=2 #2=500.0000 #3=600.0000 #4=XINTVAL
LIST BLANK AT 7 WITH 1 AFTER
LIST TITLE0 AT 7
LIST TITLE0_ AT 7 WITH 2 AFTER
LIST SIDE_T1 AT 7 WITH 1 AFTER
LIST SIDE_1 AT 10 DYL01NP AT 40
LIST SIDE_2 AT 10 DYL01PV AT 40
LIST SIDE_3 AT 10 DYL01FV AT 40
LIST SIDE_T2 AT 7 WITH 1 AFTER
LIST SIDE_4 AT 10 XINTVAL AT 40
STOP
RATE OF INTEREST SUBROUTINE
***************************
INPUT VALUES
NUMBER OF PERIODS 2
PRESENT VALUE ($) 500.0000
FUTURE VALUE ($) 600.0000
OUTPUT VALUE
RATE OF INTEREST (%) 9.5445
Here is the same routine and report where the future value is less than the present value:
FILE SYSIN CARDS DUMMY
WORKAREA
BLANK_ 45 VALUE ' '
TITLE0 45 VALUE 'RATE OF INTEREST SUBROUTINE'
TITLE0_ 45 VALUE '***************************'
SIDE_T1 30 VALUE 'INPUT VALUES '
SIDE_T2 30 VALUE 'OUTPUT VALUE '
SIDE_1 30 VALUE 'NUMBER OF PERIODS '
SIDE_4 30 VALUE 'RATE OF INTEREST (%) '
SIDE_2 30 VALUE 'PRESENT VALUE ($) '
SIDE_3 30 VALUE 'FUTURE VALUE ($) '
WORKAREA
XINTVAL 16 PD 4 A VALUE 0.0000
COPY INTVALUE #1=2 #2=500.0000 #3=450.0000 #4=XINTVAL
LIST BLANK AT 7 WITH 1 AFTER
LIST TITLE0 AT 7
LIST TITLE0_ AT 7 WITH 2 AFTER
LIST SIDE_T1 AT 7 WITH 1 AFTER
LIST SIDE_1 AT 10 DYL01NP AT 40
LIST SIDE_2 AT 10 DYL01PV AT 40
LIST SIDE_3 AT 10 DYL01FV AT 40
LIST SIDE_T2 AT 7 WITH 1 AFTER
LIST SIDE_4 AT 10 XINTVAL AT 40
STOP
RATE OF INTEREST SUBROUTINE
***************************
INPUT VALUES
NUMBER OF PERIODS 2
PRESENT VALUE ($) 500.0000
FUTURE VALUE ($) 450.0000
OUTPUT VALUE
RATE OF INTEREST (%) 5.1316-