| Language Reference |
calculates the present value of a vector of cash flows and returns a scalar

The following code presents an example of the PV function:
data a;
pv=mort(.,438.79,.10/12,30*12);
run;
proc print data=a;
run;
/* Use PROC IML PV function to compute PV. */
proc iml;
/* If rate is specified as annual rate divided */
/* by 12 and FREQ=1, then results are equal */
/* to those computed by the MORT function. */
timesn=t(do(1,360,1));
flows=repeat(438.79,360);
rate=repeat(.10/12,360);
freq=1;
pv=pv(timesn,flows,freq,rate);
print pv;
/* If rate is specified as annual rate, then */
/* the cash flow TIMES need to be specified */
/* in 1/12 increments and the FREQ=1/12. This */
/* specification returns the same result as */
/* the MORT function and the previous PV run. */
timesn=t(do(1/12,30,1/12));
flows=repeat(438.79,360);
rate=repeat(.10,360); /* specify annual rate */
freq=1/12; /* 12 compoundings annually: freq=1/12 */
pv=pv(timesn,flows,freq,rate);
print pv;
quit;
The result is as follows:
Obs pv
1 50000.48
pv
50000.48
pv
50000.48
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.