Functions and CALL Routines |
Category: | Financial |
Syntax |
FINANCE(string-identifier, parm1, parm2,...) |
specifies a character constant, variable, or expression. Valid values for string-identifier are listed in the following table.
string-identifier |
Description |
---|---|
ACCRINT |
computes the accrued interest for a security that pays periodic interest. |
ACCRINTM |
computes the accrued interest for a security that pays interest at maturity. |
AMORDEGRC |
computes the depreciation for each accounting period by using a depreciation coefficient. |
AMORLINC |
computes the depreciation for each accounting period. |
COUPDAYBS |
computes the number of days from the beginning of the coupon period to the settlement date. |
COUPDAYS |
computes the number of days in the coupon period that contains the settlement date. |
COUPDAYSNC |
computes the number of days from the settlement date to the next coupon date. |
COUPNCD |
computes the next coupon date after the settlement date. |
COUPNUM |
computes the number of coupons that are payable between the settlement date and the maturity date. |
COUPPCD |
computes the previous coupon date before the settlement date. |
CUMIPMT |
computes the cumulative interest that is paid between two periods. |
CUMPRINC |
computes the cumulative principal that is paid on a loan between two periods. |
DB |
computes the depreciation of an asset for a specified period by using the fixed-declining balance method. |
DDB |
computes the depreciation of an asset for a specified period by using the double-declining balance method or some other method that you specify. |
DISC |
computes the discount rate for a security. |
DOLLARDE |
converts a dollar price, expressed as a fraction, to a dollar price, expressed as a decimal number. |
DOLLARFR |
converts a dollar price, expressed as a decimal number, to a dollar price, expressed as a fraction. |
DURATION |
computes the annual duration of a security with periodic interest payments. |
EFFECT |
computes the effective annual interest rate. |
FV |
computes the future value of an investment. |
FVSCHEDULE |
computes the future value of an initial principal after applying a series of compound interest rates. |
INTRATE |
computes the interest rate for a fully invested security. |
IPMT |
computes the interest payment for an investment for a given period. |
IRR |
computes the internal rate of return for a series of cash flows. |
MDURATION |
computes the Macaulay modified duration for a security with an assumed face value of $100. |
MIRR |
computes the internal rate of return where positive and negative cash flows are financed at different rates. |
NOMINAL |
computes the annual nominal interest rate. |
NPER |
computes the number of periods for an investment. |
NPV |
computes the net present value of an investment based on a series of periodic cash flows and a discount rate. |
ODDFPRICE |
computes the price per $100 face value of a security with an odd first period. |
ODDFYIELD |
computes the yield of a security with an odd first period. |
ODDLPRICE |
computes the price per $100 face value of a security with an odd last period. |
ODDLYIELD |
computes the yield of a security with an odd last period. |
PMT |
computes the periodic payment for an annuity. |
PPMT |
computes the payment on the principal for an investment for a given period. |
PRICE |
computes the price per $100 face value of a security that pays periodic interest. |
PRICEDISC |
computes the price per $100 face value of a discounted security. |
PRICEMAT |
computes the price per $100 face value of a security that pays interest at maturity. |
PV |
computes the present value of an investment. |
RATE |
computes the interest rate per period of an annuity. |
RECEIVED |
computes the amount received at maturity for a fully invested security. |
SLN |
computes the straight-line depreciation of an asset for one period. |
SYD |
computes the sum-of-years digits depreciation of an asset for a specified period. |
TBILLEQ |
computes the bond-equivalent yield for a treasury bill. |
TBILLPRICE |
computes the price per $100 face value for a treasury bill. |
TBILLYIELD |
computes the yield for a treasury bill. |
VDB |
computes the depreciation of an asset for a specified or partial period by using a declining balance method. |
XIRR |
computes the internal rate of return for a schedule of cash flows that is not necessarily periodic. |
XNPV |
computes the net present value for a schedule of cash flows that is not necessarily periodic. |
YIELD |
computes the yield on a security that pays periodic interest. |
YIELDDISC |
computes the annual yield for a discounted security (for example, a treasury bill). |
YIELDMAT |
computes the annual yield of a security that pays interest at maturity. |
specifies a parameter that is associated with each string-identifier. The following parameters are available:
is an optional parameter that specifies a character or numeric value that indicates the type of day count basis to use.
Numeric Value | String Value | Day Count Method |
---|---|---|
0 | "30/360" | US (NASD) 30/360 |
1 | "ACTUAL" | Actual/actual |
2 | "ACT/360" | Actual/360 |
3 | "ACT/365" | Actual/365 |
4 | "EU30/360" | European 30/360 |
specifies rates that are provided as numeric values and not as percentages.
specifies that all dates in the financial functions are SAS dates.
for all the arguments, specifies that the cash you pay out, such as deposits to savings or other withdrawals, is represented by negative numbers. It also specifies that the cash you receive, such as dividend checks and other deposits, is represented by positive numbers.
Details |
Computes the accrued interest for a security that pays periodic interest.
Syntax |
FINANCE('ACCRINT', issue, first-interest, settlement, rate, par, frequency, <basis>); |
where
specifies the issue date of the security.
specifies the first interest date of the security.
specifies the settlement date.
specifies the interest rate.
specifies the par value of the security. If you omit par, SAS uses the value $1000.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the accrued interest for a security that pays interest at maturity.
Syntax |
FINANCE('ACCRINTM', issue, settlement, rate, par, <basis>); |
where
specifies the issue date of the security.
specifies the settlement date.
specifies the interest rate.
specifies the par value of the security. If you omit par, SAS uses the value $1000.
specifies the optional day count value.
Featured in: |
Computes the depreciation for each accounting period by using a depreciation coefficient.
Syntax |
FINANCE('AMORDEGRC', cost, date-purchased, first-period, salvage, period, rate, <basis>); |
where
specifies the initial cost of the asset.
specifies the date of the purchase of the asset.
specifies the date of the end of the first period.
specifies the value at the end of the depreciation (also called the salvage value of the asset).
specifies the depreciation period.
specifies the rate of depreciation.
specifies the optional day count value.
Tip: | When the first argument of the FINANCE function is AMORDEGRC and the value of basis is 2, the function returns a missing value. |
Featured in: |
Computes the depreciation for each accounting period.
Syntax |
FINANCE('AMORLINC', cost, date-purchased, first-period, salvage, period, rate, <basis>); |
where
specifies the initial cost of the asset.
specifies the date of the purchase of the asset.
specifies the date of the end of the first period.
specifies the value at the end of the depreciation (also called the salvage value of the asset).
specifies the depreciation period.
specifies the rate of depreciation.
specifies the optional day count value.
Tip: | When the first argument of the FINANCE function is AMORLINC and the value of basis is 2, the function returns a missing value. |
Featured in: |
Computes the number of days from the beginning of the coupon period to the settlement date.
Syntax |
FINANCE('COUPDAYBS', date-purchased, first-period, period, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the number of days in the coupon period that contains the settlement date.
FINANCE('COUPDAYS', settlement, maturity, frequency, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the number of days from the settlement date to the next coupon date.
FINANCE('COUPDAYSNC', settlement, maturity, frequency, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the next coupon date after the settlement date.
Syntax |
FINANCE('COUPNCD', settlement, maturity, frequency, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the number of coupons that are payable between the settlement date and the maturity date.
Syntax |
FINANCE('COUPNUM', settlement, maturity, frequency, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the previous coupon date before the settlement date.
Syntax |
FINANCE('COUPPCD', settlement, maturity, frequency, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the cumulative interest paid between two periods.
Syntax |
FINANCE('CUMIPMT', rate, nper, pv, start-period, end-period, <type>); |
where
specifies the interest rate.
specifies the total number of payment periods.
specifies the present value or the lump-sum amount that a series of future payments is worth currently.
specifies the first period in the calculation. Payment periods are numbered beginning with 1.
specifies the last period in the calculation.
specifies the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.
Featured in: |
Computes the cumulative principal that is paid on a loan between two periods.
Syntax |
FINANCE('CUMPRINC', rate, nper, pv, start-period, end-period, <type>); |
where
specifies the interest rate.
specifies the total number of payment periods.
specifies the present value or the lump-sum amount that a series of future payments is worth currently.
specifies the first period in the calculation. Payment periods are numbered beginning with 1.
specifies the last period in the calculation.
specifies the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.
Featured in: |
Computes the depreciation of an asset for a specified period by using the fixed-declining balance method.
Syntax |
FINANCE('DB', cost, salvage, life, period, <month>); |
where
specifies the initial cost of the asset.
specifies the value at the end of the depreciation (also called the salvage value of the asset).
specifies the number of periods over which the asset is depreciated (also called the useful life of the asset).
specifies the period for which you want to calculate the depreciation. Period must use the same time units as life.
specifies the number of months (month is an optional numeric argument). If month is omitted, it defaults to a value of 12.
Featured in: |
Computes the depreciation of an asset for a specified period by using the double-declining balance method or some other method that you specify.
Syntax |
FINANCE('DDB', cost, salvage, life, period, <factor>); |
where
specifies the initial cost of the asset.
specifies the value at the end of the depreciation (also called the salvage value of the asset).
specifies the number of periods over which the asset is depreciated (also called the useful life of the asset).
specifies the period for which you want to calculate the depreciation. Period must use the same time units as life.
specifies the rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method).
Featured in: |
Computes the discount rate for a security.
Syntax |
FINANCE('DISC', settlement, maturity, pr, redemption, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the price of security per $100 face value.
specifies the amount to be received at maturity.
specifies the optional day count value.
Featured in: |
Converts a dollar price, expressed as a fraction, to a dollar price, expressed as a decimal number.
Syntax |
FINANCE('DOLLARDE', fractionaldollar, fraction); |
where
specifies the number expressed as a fraction.
specifies the integer to use in the denominator of a fraction.
Featured in: |
Converts a dollar price, expressed as a decimal number, to a dollar price, expressed as a fraction.
Syntax |
FINANCE('DOLLARFR', decimaldollar, fraction); |
where
specifies a decimal number.
specifies the integer to use in the denominator of a fraction.
Featured in: |
Computes the annual duration of a security with periodic interest payments.
Syntax |
FINANCE('DURATION', settlement, maturity, coupon, yld, frequency, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the annual coupon rate of the security.
specifies the annual yield of the security.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the effective annual interest rate.
Syntax |
FINANCE('EFFECT', nominalrate, npery); |
where
specifies the nominal interest rate.
specifies the number of compounding periods per year.
Featured in: |
Computes the future value of an investment.
Syntax |
FINANCE('FV', rate, nper, <pmt>, <pv>, <type>); |
where
specifies the interest rate.
specifies the total number of payment periods.
specifies the payment that is made each period; the payment cannot change over the life of the annuity. Typically, pmt contains principal and interest but no fees and taxes. If pmt is omitted, you must include the pv argument.
specifies the present value or the lump-sum amount that a series of future payments is worth currently. If pv is omitted, it is assumed to be 0 (zero), and you must include the pmt argument.
specifies the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.
Featured in: |
Computes the future value of the initial principal after applying a series of compound interest rates.
Syntax |
FINANCE('FVSCHEDULE', principal, schedule1, schedule2...); |
where
specifies the present value.
specifies the sequence of interest rates to apply.
Featured in: |
Computes the interest rate for a fully invested security.
Syntax |
FINANCE('INTRATE', settlement, maturity, investment, redemption, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the amount that is invested in the security.
specifies the amount to be received at maturity.
specifies the optional day count value.
Featured in: |
Computes the interest payment for an investment for a specified period.
Syntax |
FINANCE('IPMT', rate, period, nper, pv, <fv>, <type>); |
where
specifies the interest rate.
specifies the period for which you want to calculate the depreciation. Period must use the same units as life.
specifies the total number of payment periods.
specifies the present value or the lump-sum amount that a series of future payments is worth currently. If pv is omitted, it is assumed to be 0 (zero), and you must include the fv argument.
specifies the future value or a cash balance that you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (for example, the future value of a loan is 0).
specifies the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.
Featured in: |
Computes the internal rate of return for a series of cash flows.
Syntax |
FINANCE('IRR', value1, value2, ..., value_n); |
where
specifies a list of numeric arguments that contain numbers for which you want to calculate the internal rate of return.
Featured in: |
Computes the Macaulay modified duration for a security with an assumed face value of $100.
Syntax |
FINANCE('MDURATION', settlement, maturity, coupon, yld, frequency, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the annual coupon rate of the security.
specifies the annual yield of the security.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the internal rate of return where positive and negative cash flows are financed at different rates.
Syntax |
FINANCE('MIRR', value1, ..., value_n, financerate, reinvestrate); |
where
specifies a list of numeric arguments that contain numbers. These numbers represent a series of payments (negative values) and income (positive values) that occur at regular periods. Values must contain at least one positive value and one negative value to calculate the modified internal rate of return.
specifies the interest rate that you pay on the money that is used in the cash flows.
specifies the interest rate that you receive on the cash flows as you reinvest them.
Featured in: |
Computes the annual nominal interest rates.
Syntax |
FINANCE('NOMINAL', effectrate, npery); |
where
specifies the effective interest rate.
specifies the number of compounding periods per year.
Featured in: |
Computes the number of periods for an investment.
Syntax |
FINANCE('NPER', rate, pmt, pv, <fv>, <type>); |
where
specifies the interest rate.
specifies the payment that is made each period; the payment cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes. If pmt is omitted, you must include the pv argument.
specifies the present value or the lump-sum amount that a series of future payments is worth currently. If pv is omitted, it is assumed to be 0 (zero), and you must include the pmt argument.
specifies the future value or a cash balance that you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (for example, the future value of a loan is 0).
specifies the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.
Featured in: |
Computes the net present value of an investment based on a series of periodic cash flows and a discount rate.
Syntax |
FINANCE('NPV', rate, value-1 <,...value-n> ); |
where
specifies the interest rate.
represents the sequence of the cash flows.
Featured in: |
Computes the price of a security per $100 face value with an odd first period.
Syntax |
FINANCE('ODDFPRICE', settlement, maturity, issue, first-coupon, rate, yld, redemption, frequency, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the issue date of the security.
specifies the first coupon date of the security.
specifies the interest rate.
specifies the annual yield of the security.
specifies the amount to be received at maturity.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the yield of a security with an odd first period.
Syntax |
FINANCE('ODDFYIELD', settlement, maturity, issue, first-coupon, rate, pr, redemption, frequency, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the issue date of the security.
specifies the first coupon date of the security.
specifies the interest rate.
specifies the price of the security per $100 face value.
specifies the amount to be received at maturity.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the price of a security per $100 face value with an odd last period.
Syntax |
FINANCE('ODDLPRICE', settlement, maturity, last_interest, rate, yld, redemption, frequency, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the last coupon date of the security.
specifies the interest rate.
specifies the annual yield of the security.
specifies the amount to be received at maturity.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the yield of a security with an odd last period.
Syntax |
FINANCE('ODDLYIELD', settlement, maturity, last_interest, rate, pr, redemption, frequency, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the last coupon date of the security.
specifies the interest rate.
specifies the price of the security per $100 face value.
specifies the amount to be received at maturity.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the periodic payment of an annuity.
Syntax |
FINANCE('PMT', rate, nper, pv, <fv>, <type>); |
where
specifies the interest rate.
specifies the number of payment periods.
specifies the present value or the lump-sum amount that a series of future payments is worth currently. If pv is omitted, it is assumed to be 0 (zero), and you must include the fv argument.
specifies the future value or a cash balance that you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (for example, the future value of a loan is 0).
specifies the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.
Featured in: |
Computes the payment on the principal for an investment for a specified period.
Syntax |
FINANCE('PPMT', rate, per, nper, pv, <fv>, <type>); |
where
specifies the interest rate.
specifies the period.
Range: | 1-nper |
specifies the number of payment periods.
specifies the present value or the lump-sum amount that a series of future payments is worth currently. If pv is omitted, it is assumed to be 0 (zero), and you must include the fv argument.
specifies the future value or a cash balance that you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (for example, the future value of a loan is 0).
specifies the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.
Featured in: |
Computes the price of a security per $100 face value that pays periodic interest.
Syntax |
FINANCE('PRICE', settlement, maturity, rate, yld, redemption, frequency, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the interest rate.
specifies the annual yield of the security.
specifies the amount to be received at maturity.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the price of a discounted security per $100 face value.
Syntax |
FINANCE('PRICEDISC', settlement, maturity, discount, redemption, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the discount rate of the security.
specifies the amount to be received at maturity.
specifies the optional day count value.
Featured in: |
Computes the price of a security per $100 face value that pays interest at maturity.
Syntax |
FINANCE('PRICEMAT', settlement, maturity, issue, rate, yld, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the issue date of the security.
specifies the interest rate.
specifies the annual yield of the security.
specifies the optional day count value.
Featured in: |
Computes the present value of an investment.
Syntax |
FINANCE('PV', rate, nper, pmt, <fv>, <type>); |
where
specifies the interest rate.
specifies the total number of payment periods.
specifies the payment that is made each period; the payment cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes.
specifies the future value or a cash balance that you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (for example, the future value of a loan is 0).
specifies the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.
Featured in: |
Computes the interest rate per period of an annuity.
Syntax |
FINANCE('RATE', nper, pmt, pv, <fv>, <type>); |
where
specifies the total number of payment periods.
specifies the payment that is made each period; the payment cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes. If pmt is omitted, you must include the pv argument.
specifies the present value or the lump-sum amount that a series of future payments is worth currently. If pv is omitted, it is assumed to be 0 (zero), and you must include the fv argument.
specifies the future value or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (for example, the future value of a loan is 0).
specifies the number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0.
Featured in: |
Computes the amount that is received at maturity for a fully invested security.
Syntax |
FINANCE('RECEIVED', settlement, maturity, investment, discount, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the amount that is invested in the security.
specifies the discount rate of the security.
specifies the optional day count value.
Featured in: |
Computes the straight-line depreciation of an asset for one period.
Syntax |
FINANCE('SLN', cost, salvage, life); |
where
specifies the initial cost of the asset.
specifies the value at the end of the depreciation (also called the salvage value of an asset).
specifies the number of periods over which the asset is depreciated (also called the useful life of the asset).
Featured in: |
Computes the sum-of-years digits depreciation of an asset for a specified period.
Syntax |
FINANCE('SYD', cost, salvage, life, period); |
where
specifies the initial cost of the asset.
specifies the value at the end of the depreciation (also called the salvage value of the asset).
specifies the number of periods over which the asset is depreciated (also called the useful life of the asset).
specifies a period in the same time units that are used for the argument life.
Featured in: |
Computes the bond-equivalent yield for a treasury bill.
Syntax |
FINANCE('TBILLEQ', settlement, maturity, discount); |
where
specifies the settlement date.
specifies the maturity date.
specifies the discount rate of the security.
Featured in: |
Computes the price of a treasury bill per $100 face value.
Syntax |
FINANCE('TBILLPRICE', settlement, maturity, discount); |
where
specifies the settlement date.
specifies the maturity date.
specifies the discount rate of the security.
See |
Featured in: |
Computes the yield for a treasury bill.
Syntax |
FINANCE('TBILLYIELD', settlement, maturity, pr); |
where
specifies the settlement date.
specifies the maturity date.
specifies the price of the security per $100 face value.
Featured in: |
Computes the depreciation of an asset for a specified or partial period by using a declining balance method.
Syntax |
FINANCE('VDB', cost, salvage, life, start-period, end-period, <factor>, <noswitch>); |
where
specifies the initial cost of the asset.
specifies the value at the end of the depreciation (also called the salvage value of the asset).
specifies the number of periods over which the asset is depreciated (also called the useful life of the asset).
specifies the first period in the calculation. Payment periods are numbered beginning with 1.
specifies the last period in the calculation.
specifies the rate at which the balance declines. If factor is omitted, it is assumed to be 2 (the double-declining balance method).
specifies a logical value that determines whether to switch to straight-line depreciation when the depreciation is greater than the declining balance calculation. If noswitch is omitted, it is assumed to be 1.
Featured in: |
Computes the internal rate of return for a schedule of cash flows that is not necessarily periodic.
Syntax |
FINANCE('XIRR', values, dates, <guess>); |
where
specifies a series of cash flows that corresponds to a schedule of payments in dates. The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. The series of values must contain at least one positive value and one negative value.
specifies a schedule of payment dates that corresponds to the cash flow payments. The first payment date indicates the beginning of the schedule of payments. All other dates must be later than this date, but they can occur in any order.
specifies an optional number that you guess is close to the result of XIRR.
Featured in: |
Computes the net present value for a schedule of cash flows that is not necessarily periodic.
Syntax |
FINANCE('XNPV', rate, values, dates); |
where
specifies the interest rate.
specifies a series of cash flows that corresponds to a schedule of payments in dates. The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. The series of values must contain at least one positive value and one negative value.
specifies a schedule of payment dates that corresponds to the cash flow payments. The first payment date indicates the beginning of the schedule of payments. All other dates must be later than this date, but they can occur in any order.
Featured in: |
Computes the yield on a security that pays periodic interest.
Syntax |
FINANCE('YIELD', settlement, maturity, rate, pr, redemption, frequency, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the interest rate.
specifies the price of the security per $100 face value.
specifies the amount to be received at maturity.
specifies the number of coupon payments per year. For annual payments, frequency = 1; for semiannual payments, frequency = 2; for quarterly payments, frequency = 4.
specifies the optional day count value.
Featured in: |
Computes the annual yield for a discounted security (for example, a treasury bill).
Syntax |
FINANCE('YIELDDISC', settlement, maturity, rate, pr, redemption, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the interest rate.
specifies the price of the security per $100 face value.
specifies the amount to be received at maturity.
specifies the optional day count value.
Featured in: |
Computes the annual yield of a security that pays interest at maturity.
Syntax |
FINANCE('YIELDMAT', settlement, maturity, issue, rate, pr, <basis>); |
where
specifies the settlement date.
specifies the maturity date.
specifies the issue date of the security.
specifies the interest rate.
specifies the price of the security per $100 face value.
specifies the optional day count value.
Featured in: |
Examples |
The following example computes the accrued interest for a security that pays periodic interest.
data _null_; issue = mdy(2,27,1996); firstinterest = mdy(8,31,1998); settlement = mdy(5,1,1998); rate = 0.1; par = 1000; frequency = 2; basis = 1; r = finance('accrint', issue, firstinterest, settlement, rate, par, frequency, basis); put r=; run;
The value of r that is returned is 217.39728.
The following example computes the accrued interest for a security that pays interest at maturity.
data _null_; issue = mdy(2,28,1998); maturity = mdy(8,31,1998); rate = 0.1; par = 1000; basis = 0; r = finance('accrintm', issue, maturity, rate, par, basis); put r=; run;
The value of r that is returned is 50.555555556.
The following example computes the depreciation for each accounting period by using a depreciation coefficient.
data _null_; cost = 2400; datepurchased = mdy(8,19,2008); firstperiod = mdy(12,31,2008); salvage = 300; period = 1; rate = 0.15; basis = 1; r = finance('amordegrc', cost, datepurchased, firstperiod, salvage, period, rate, basis); put r=; run;
The value of r that is returned is 776.
The following example computes the depreciation for each accounting period.
data _null_; cost = 2400; dp = mdy(9,30,1998); fp = mdy(12,31,1998); salvage = 245; period = 0; rate = 0.115; basis = 0; r = finance('amorlinc', cost, dp, fp, salvage, period, rate, basis); put r = ; run;
The value of r that is returned is 69.
The following example computes the number of days from the beginning of the coupon period to the settlement date.
data _null_; settlement = mdy(12,30,1994); maturity = mdy(11,29,1997); frequency = 4; basis = 2; r = finance('coupdaybs', settlement, maturity, frequency, basis); put r = ; run;
The value of r that is returned is 31.
The following example computes the number of days in the coupon period that contains the settlement date.
data _null_; settlement = mdy(1,25,2007); maturity = mdy(11,15,2008); frequency = 2; basis = 1; r = finance('coupdays', settlement, maturity, frequency, basis); put r = ; run;
The value of r that is returned is 181.
The following example computes the number of days from the settlement date to the next coupon date.
data _null_; settlement = mdy(1,25,2007); maturity = mdy(11,15,2008); frequency = 2; basis = 1; r = finance('coupdaysnc', settlement, maturity, frequency, basis); put r = ; run;
The value of r that is returned is 110.
The following example computes the next coupon date after the settlement date.
data _null_; settlement = mdy(1,25,2007); maturity = mdy(11,15,2008); frequency = 2; basis = 1; r = finance('coupncd', settlement, maturity, frequency, basis); put r = date7.; run;
The value of r that is returned is 15MAY07.
Note: r is a numeric SAS value and can be printed using the DATE7 format.
The following example computes the number of coupons that are payable between the settlement date and the maturity date.
data _null_; settlement = mdy(1,25,2007); maturity = mdy(11,15,2008); frequency = 2; basis = 1; r = finance('coupnum', settlement, maturity, frequency, basis); put r = ; run;
The value of r that is returned is 4.
The following example computes the previous coupon date before the settlement date.
data _null_; settlement = mdy(1,25,2007); maturity = mdy(11,15,2008); frequency = 2; basis = 1; r = finance('couppcd', settlement, maturity, frequency, basis); put settlement; put maturity; put r date7.; run;
The value of r that is returned is 11/15/2006.
The following example computes the cumulative interest that is paid between two periods.
data _null_; rate = 0.09; nper = 30; pv = 125000; startperiod = 13; endperiod = 24; type = 0; r = finance('cumipmt', rate, nper, pv, startperiod, endperiod, type); put r = ; run;
The value of r that is returned is -94054.82033.
The following example computes the cumulative principal that is paid on a loan between two periods.
data _null_; rate = 0.09; nper = 30; pv = 125000; startperiod = 13; endperiod = 24; type = 0; r = finance('cumprinc', rate, nper, pv, startperiod, endperiod, type); put r = ; run;
The value of r that is returned is -51949.70676.
The following example computes the depreciation of an asset for a specified period by using the fixed-declining balance method.
data _null_; cost = 1000000; salvage = 100000; life = 6; period = 2; month = 7; r = finance('db', cost, salvage, life, period, month); put r = ; run;
The value of r that is returned is 259639.41667.
The following example computes the depreciation of an asset for a specified period by using the double-declining balance method or some other method that you specify.
data _null_; cost = 2400; salvage = 300; life = 10*365; period = 1; factor = .; r = finance('ddb', cost, salvage, life, period, factor); put r = ; run;
The value of r that is returned is 1.3150684932.
The following example computes the discount rate for a security.
data _null_; settlement = mdy(1,25,2007); maturity = mdy(6,15,2007); pr = 97.975; redemption = 100; basis = 1; r = finance('disc', settlement, maturity, pr, redemption, basis); put r = ; run;
The value of r that is returned is 0.052420213.
The following example converts a dollar price, expressed as a fraction, to a dollar price, expressed as a decimal number.
data _null_; fractionaldollar = 1.125; fraction = 16; r = finance('dollarde', fractionaldollar, fraction); put r = ; run;
The value of r that is returned is 1.78125.
The following example converts a dollar price, expressed as a decimal number, to a dollar price, expressed as a fraction.
data _null_; decimaldollar = 1.125; fraction = 16; r = finance('dollarfr', decimaldollar, fraction); put r = ; run;
The value of r that is returned is 1.02. In fraction form, the value of r is read as .
The following example computes the annual duration of a security with periodic interest payments.
data _null_; settlement = mdy(1,1,2008); maturity = mdy(1,1,2016); couponrate = 0.08; yield = 0.09; frequency = 2; basis = 1; r = finance('duration', settlement, maturity, couponrate, yield, frequency, basis); put r = ; run;
The value of r that is returned is 5.993775.
The following example computes the effective annual interest rate.
data _null_; nominalrate = 0.0525; npery = 4; r = finance('effect', nominalrate, npery); put r = ; run;
The value of r that is returned is 0.053543.
The following example computes the future value of an investment.
data _null_; rate = 0.06/12; nper = 10; pmt = -200; pv = -500; type = 1; r = finance('fv', rate, nper, pmt, pv, type); put r = ; run;
The value of r that is returned is 2581.4033741.
The following example computes the future value of the initial principal after applying a series of compound interest rates.
data _null_; principal = 1; r1 = 0.09; r2 = 0.11; r3 = 0.1; r = finance('fvschedule', principal, r1, r2, r3); put r = ; run;
The value of r that is returned is 1.33089.
The following example computes the interest rate for a fully invested security.
data _null_; settlement = mdy(2,15,2008); maturity = mdy(5,15,2008); investment = 1000000; redemption = 1014420; basis = 2; r = finance('intrate', settlement, maturity, investment, redemption, basis); put r = ; run;
The value of r that is returned is 0.05768
The following example computes the interest payment for an investment for a specified period.
data _null_; rate = 0.1/12; per = 2; nper = 3; pv = 100; fv = .; type = .; r = finance('ipmt', rate, per, nper, pv, fv, type); put r = ; run;
The value of r that is returned is -0.557857564.
The following example computes the internal rate of return for a series of cash flows.
data _null_; v1 = -70000; v2 = 12000; v3 = 15000; v4 = 18000; v5 = 21000; v6 = 26000; r = finance('irr', v1, v2, v3, v4, v5, v6); put r = ; run;
The value of r that is returned is 0.086630948.
The following example computes the Macaulay modified duration for a security with an assumed face value of $100.
data _null_; settlement = mdy(1,1,2008); maturity = mdy(1,1,2016); couponrate = 0.08; yield = 0.09; frequency = 2; basis = 1; r = finance('mduration', settlement, maturity, couponrate, yield, frequency, basis); put r = ; run;
The value of r that is returned is 5.7356698139.
The following example computes the internal rate of return where positive and negative cash flows are financed at different rates.
data _null_; v1 = -1000; v2 = 3000; v3 = 4000; v4 = 5000; financerate = 0.08; reinvestrate = 0.10; r = finance('mirr', v1, v2, v3, v4, financerate, reinvestrate); put r = ; run;
The value of r that is returned is 1.3531420172.
The following example computes the annual nominal interest rate.
data _null_; effectrate = 0.08; npery = 4; r = finance('nominal', effectrate, npery); put r = ; run;
The value of r that is returned is 0.0777061876.
The following example computes the number of periods for an investment.
data _null_; rate = 0.08; pmt = 200; pv = 1000; fv = 0; type = 0; r = finance('nper', rate, pmt, pv, fv, type); put r = ; run;
The value of r that is returned is -4.371981351.
The following example computes the net present value of an investment based on a series of periodic cash flows and a discount rate.
data _null_; rate = 0.08; v1 = 200; v2 = 1000; v3 = 0.; r = finance('npv', rate, v1, v2, v3); put r = ; run;
The value of r that is returned is 1042.5240055.
The following example computes the price of a security per $100 face value with an odd first period.
data _null_; settlement = mdy(1,15,93); maturity = mdy(1,1,98); issue = mdy(1,1,93); firstcoupon = mdy(7,1,94); rate = 0.07; yld = 0.06; redemption = 100; frequency = 2; basis = 0; r = finance('oddfprice', settlement, maturity, issue, firstcoupon, rate, yld, redemption, frequency, basis); put r = ; run;
The value of r that is returned is 103.94103984.
The following example computes the interest of a yield with an odd first period.
data _null_; settlement = mdy(1,15,93); maturity = mdy(1,1,98); issue = mdy(1,1,93); firstcoupon = mdy(7,1,94); rate = 0.07; pr = 103.94103984; redemption = 100; frequency = 2; basis = 0; r = finance('oddfyield', settlement, maturity, issue, firstcoupon, rate, pr, redemption, frequency, basis); put r = ; run;
The value of r that is returned is 0.06.
The following example computes the price of a security per $100 face value with an odd last period.
data _null_; settlement = mdy(2,7,2008); maturity = mdy(6,15,2008); lastinterest = mdy(10,15,2007); rate = 0.0375; yield = 0.0405; redemption = 100; frequency = 2; basis = 0; r = finance('oddlprice', settlement, maturity, lastinterest, rate, yield, redemption, frequency, basis); put r = ; run;
The value of r that is returned is 99.878286015.
The following example computes the yield of a security with an odd last period.
data _null_; settlement = mdy(2,7,2008); maturity = mdy(6,15,2008); lastinterest = mdy(10,15,2007); rate = 0.0375; pr = 99.878286015; redemption = 100; frequency = 2; basis = 0; r = finance('oddlyield', settlement, maturity, lastinterest, rate, pr, redemption, frequency, basis); put r = ; run;
The value of r that is returned is 0.0405.
The following example computes the periodic payment for an annuity.
data _null_; rate = 0.08; nper = 5; pv = 91; fv = 3; type = 0; r = finance('pmt', rate, nper, pv, fv, type); put r = ; run;
The value of r that is returned is -23.30290673.
The following example computes the payment on the principal for an investment for a specified period.
data _null_; rate = 0.08; per = 10; nper = 10; pv = 200000; fv = 0; type = 0; r = finance('ppmt', rate, per, nper, pv, fv, type); put r = ; run;
The value of r that is returned is -27598.05346.
The following example computes the price of a security per $100 face value that pays periodic interest.
data _null_; settlement = mdy(2,15,2008); maturity = mdy(11,15,2017); rate = 0.0575; yield = 0.065; redemption = 100; frequency = 2; basis = 0; r = finance('price', settlement, maturity, rate, yield, redemption, frequency, basis); put r = ; run;
The value of r that is returned is 94.634361621.
The following example computes the price of a discounted security per $100 face value.
data _null_; settlement = mdy(2,15,2008); maturity = mdy(11,15,2017); discount = 0.0525; redemption = 100; basis = 0; r = finance('pricedisc', settlement, maturity, discount, redemption, basis); put r = ; run;
The value of r that is returned is 48.8125.
The following example computes the price of a security per $100 face value that pays interest at maturity.
data _null_; settlement = mdy(2,15,2008); maturity = mdy(4,13,2008); issue = mdy(11,11,2007); rate = 0.061; yield = 0.061; basis = 0; r = finance('pricemat', settlement, maturity, issue, rate, yield, basis); put r = ; run;
The value of r that is returned is 99.98449888.
The following example computes the present value of an investment.
data _null_; rate = 0.05; nper = 10; pmt = 1000; fv = 200; type = 0; r = finance('pv', rate, nper, pmt, fv, type); put r = ; run;
The value of r that is returned is -7844.51758.
The following example computes the interest rate per period of an annuity.
data _null_; nper = 4; pmt = -2481; pv = 8000; r = finance('rate', nper, pmt, pv); put r = ; run;
The value of r that is returned is 0.0921476841.
The following example computes the amount that is received at maturity for a fully invested security.
data _null_; settlement = mdy(2,15,2008); maturity = mdy(5,15,2008); investment = 1000000; discount = 0.0575; basis = 2; r = finance('received', settlement, maturity, investment, discount, basis); put r = ; run;
The value of r that is returned is 1014584.6544.
The following example computes the straight-line depreciation of an asset for one period.
data _null_; cost = 2000; salvage = 200; life = 11; r = finance('sln', cost, salvage, life); put r = ; run;
The value of r that is returned is 163.63636364.
The following example computes the sum-of-years digits depreciation of an asset for a specified period.
data _null_; cost = 2000; salvage = 200; life = 11; per = 1; r = finance('syd', cost, salvage, life, per); put r = ; run;
The value of r that is returned is 300.
The following example computes the bond-equivalent yield for a treasury bill.
data _null_; settlement = mdy(3,31,2008); maturity = mdy(6,1,2008); discount = 0.0914; r = finance('tbilleq', settlement, maturity, discount); put r = ; run;
The value of r that is returned is 0.0941514936.
The following example computes the price of a treasury bill per $100 face value.
data _null_; settlement = mdy(3,31,2008); maturity = mdy(6,1,2008); discount = 0.09; r = finance('tbillprice', settlement, maturity, discount); put r = ; run;
The value of r that is returned is 98.45.
The following example computes the yield for a treasury bill.
data _null_; settlement = mdy(3,31,2008); maturity = mdy(6,1,2008); pr = 98; r = finance('tbillyield', settlement, maturity, pr); put r = ; run;
The value of r that is returned is 0.1184990125.
The following example computes the depreciation of an asset for a specified or partial period by using a declining balance method.
data _null_; cost = 2400; salvage = 300; life = 10; startperiod = 0; endperiod = 1; factor = 1.5; r = finance('vdb', cost, salvage, life, startperiod, endperiod, factor); put r = ; run;
The value of r that is returned is 360.
The following example computes the internal rate of return for a schedule of cash flows that is not necessarily periodic.
data _null_; v1 = -10000; d1 = mdy(1,1,2008); v2 = 2750; d2 = mdy(3,1,2008); v3 = 4250; d3 = mdy(10,30,2008); v4 = 3250; d4 = mdy(2,15,2009); v5 = 2750; d5 = mdy(4,1,2009); r = finance('xirr', v1, v2, v3, v4, v5, d1, d2, d3, d4, d5, 0.1); put r = ; run;
The value of r that is returned is 0.3733625335.
The following example computes the net present value for a schedule of cash flows that is not necessarily periodic.
data _null_; r = 0.09; v1 = -10000; d1 = mdy(1,1,2008); v2 = 2750; d2 = mdy(3,1,2008); v3 = 4250; d3 = mdy(10,30,2008); v4 = 3250; d4 = mdy(2,15,2009); v5 = 2750; d5 = mdy(4,1,2009); r = finance('xnpv', r, v1, v2, v3, v4, v5, d1, d2, d3, d4, d5); put r = ; run;
The value of r that is returned is 2086.647602.
The following example computes the yield on a security that pays periodic interest.
data _null_; settlement = mdy(2,15,2008); maturity = mdy(11,15,2016); rate = 0.0575; pr = 95.04287; redemption = 100; frequency = 2; basis = 0; r = finance('yield', settlement, maturity, rate, pr, redemption, frequency, basis); put r = ; run;
The value of r that is returned is 0.0650000069.
The following example computes the annual yield for a discounted security (for example, a treasury bill).
data _null_; settlement = mdy(2,15,2008); maturity = mdy(11,15,2016); pr = 95.04287; redemption = 100; basis = 0; r = finance('yielddisc', settlement, maturity, pr, redemption, basis); put r = ; run;
The value of r that is returned is 0.0059607748.
The following example computes the annual yield of a security that pays interest at maturity.
data _null_; settlement = mdy(3,15,2008); maturity = mdy(11,3,2008); issue = mdy(11,8,2007); rate = 0.0625; pr = 100.0123; basis = 0; r = finance('yieldmat', settlement, maturity, issue, rate, pr, basis); put r = ; run;
The value of r that is returned is 0.0609543337.
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.