Computes financial calculations such as depreciation, maturation, accrued interest, net present value, periodic savings, and internal rates of return.
Category: | Financial |
specifies a parameter that is associated with each string-identifier. The following parameters are available:
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 that you pay out, such as deposits to savings or other withdrawals, is represented by negative numbers. It also specifies that the cash that you receive, such as dividend checks and other deposits, is represented by positive numbers.
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;
data _null_; cost = 2400; salvage = 300; life = 10*365; period = 1; factor = .; r = finance('ddb', cost, salvage, life, period, factor); put r = ; run;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;