SAVINGS Function

Returns the balance of a periodic savings by using variable interest rates.

Category: Financial
Returned data type: DOUBLE

Syntax

Arguments

base-date

specifies the value that is returned is the balance of the savings at the base date.

Requirement Base-date is a SAS date.
Data type DOUBLE

initial-deposit-date

specifies the date of the first deposit. Subsequent deposits are at the beginning of subsequent deposit intervals.

Requirement Initial-deposit-date is a SAS date.
Data type DOUBLE

deposit-amount

specifies the value of each deposit. All deposits are assumed constant.

Data type DOUBLE

deposit-number

specifies the number of deposits.

Data type INTEGER

deposit-interval

specifies the frequency at which deposits are made.

Requirement Deposit-interval is a SAS interval.
Data type CHAR

compounding-interval

specifies the compounding interval.

Requirement Compounding-interval is a SAS interval.
Data type CHAR

date

specifies the time at which rate takes effect. Each date is paired with a rate.

Requirement Date is a SAS date.
Data type DOUBLE

rate

specifies the interest rate as numeric percentage that starts on date. Each rate is paired with a date.

Data type DOUBLE

Details

The following details apply to the SAVINGS function:
  • The values for rates must be between –99 and 120.
  • Deposit-interval cannot be 'CONTINUOUS'.
  • The list of date-rate pairs does not need to be in chronological order.
  • When multiple rate changes occur on a single date, the SAVINGS function applies only the final rate that is listed for that date.
  • Simple interest is applied for partial periods.
  • There must be a valid date-rate pair whose date is at or prior to both the initial-deposit-date and the base-date.

Example

  • If you deposit $300 monthly for two years into an account that compounds quarterly at an annual rate of 4%, the balance of the account after five years can be expressed as follows:
    select savings(date'2005-01-01', date'2000-01-01',
       300, 24, 'month', 'qtr', date'2000-01-01',4.00);
    The following line is written to the SAS log.
    8458.794159
  • If the interest rate increases by a quarter-point each year, then the balance of the account could be expressed as follows:
    select savings(date'2005-01-01', date'2000-01-01',
       300, 24, 'month', 'qtr', date'2000-01-01', 4.00, date'2001-01-01', 4.25, 
     date'2002-01-01', 4.50, date'2003-01-01', 4.75, date'2004-01-01', 5.0);
    The following line is written to the SAS log.
    8665.5059376
  • To determine the balance after one year of deposits, the following statement sets amount_base3 to the desired balance:
    select savings(date'2001-01-01', date'2000-01-01',
       300, 24, 'month', 'qtr', date'2000-01-01',4);
    The following line is written to the SAS log.
    3978.69037121739
The SAVINGS function ignores deposits after the base date, so the deposits after the reference date do not affect the value that is returned.
Last updated: February 23, 2017