/ Published in: SAS
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
proc fcmp outlib = sasuser.exsubs.pkt1; Note about code subroutine calc_years(maturity, current_date, years); outargs years; years = (maturity - current_date) / 365.25; endsub; Note about code function garkhprc (type$, buysell$, amount, E, t, S, rd, rf, sig); if buysell = "Buy" then sign = 1.; else do; if buysell = "Sell" then sign = -1.; else sign = .; end; if type = "Call" then garkhprc = sign * amount * garkhptprc (E, t, S, rd, rf, sig); else do; if type = "Put" then garkhprc = sign * amount * garkhptprc (E, t, S, rd, rf, sig); else garkhprc = .; end; Note about code return (garkhprc); endsub; Note about code run;
URL: http://support.sas.com/documentation/cdl/en/proc/59565/HTML/default/a002890491.htm