Return to Snippet

Revision: 8659
at October 2, 2008 13:42 by webonomic


Initial Code
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;

Initial URL
http://support.sas.com/documentation/cdl/en/proc/59565/HTML/default/a002890491.htm

Initial Description

                                

Initial Title
Proc FCMP Creating a Call Routine and Function

Initial Tags

                                

Initial Language
SAS