title: Date calculations in SAS
body: <p>I want to add 1 day to an arbitrary SAS date. I have the following code that works but I wonder wether there is built-in support for date calculations like this:</p>
  
  <pre><code>proc fcmp outlib=whatever;  
  function lastDayInYear(d);  
      if datdif(d,mdy(12,31,year(d)),'ACT/365')=0 then return(1); else return(0);  
  endsub;  
  
  function advanceDate(d);
      if d=. then return(.);
      if lastDayInYear(d) then
          return(mdy(1,1,year(d)+1));
      else
          return(datejul(juldate7(d)+1));
  endsub;
  quit;
  </code></pre>