PV Function
calculates the present value of a vector of cashflows and returns a scalar
The PV function returns a scalar containing the present value of the cashflows
based on the specified frequency and rates.
 times
 is an n x 1 column vector of times.
Elements should be nonnegative.
 flows
 is an n x 1 column vector of cashflows.
 freq
 is a scalar which represents the base of the rates
to be used for discounting the cashflows.
If positive, it represents discrete compounding
as the reciprocal of the number of compoundings.
If zero, it represents continuous compounding.
If 1, it represents perperiod discount factors.
No other negative values are allowed.
 rates
 is an n x 1 column vector of rates
to be used for discounting the cashflows.
Elements should be positive.
A general present value relationship can be written as:
where P is the present value of the asset,
{c(k)}k = 1,..K is the
sequence of cashflows from the asset, t_{k} is the time to the
kth cashflow in periods from the present, and
D(t) is the discount function for time t.
With perunittimeperiod discount factors d_{t}:

D(t) = d_{t}^{t}
With continuous compunding:

D(t) = e^{rt t}
With discrete compunding:

D(t) = (1+fr)^{(t/f)}
where f > 0 is the frequency, the reciprocal of the number of
compoundings per unit time period.
Example
proc iml;
timesn=do(1,100,1);
timesn=T(timesn);
flows=repeat(10,100);
freq=0;
do while(freq<50);
freq=freq+.25;
end;
rate=repeat(.10,100);
pv=pv(timesn,flows,freq,rate);
print pv;
quit;
PV
266.4717
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.