Create a function to calculate years to maturity. A generic function called CALC_YEARS is declared to calculate years to maturity from date variables that are stored as the number of days. The OUTARGS statement specifies the variable that will be updated by CALC_YEARS.


   subroutine calc_years(maturity, current_date, years);
      outargs years;
      years = (maturity - current_date) / 365.25;
   endsub;