<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: calculate difference in 2 dates based on 360 days year in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/calculate-difference-in-2-dates-based-on-360-days-year/m-p/309940#M66796</link>
    <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc fcmp outlib=WORK.FUNC.TEST;
  function days360(END, START);
    Y=intck('year',START, END);
    N=Y*360+intck('day',START,intnx('year',END,-Y,'s'));
    return (N);
  endsub;
run;

options cmplib=WORK.FUNC;
 
data _null_;
  END   = '07dec2016'd;
  START = '8nov2014'd;
  DAYS  = days360(END, START);
  putlog DAYS=;
run;
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;DAYS=749&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2016 04:54:46 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2016-11-08T04:54:46Z</dc:date>
    <item>
      <title>calculate difference in 2 dates based on 360 days year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-difference-in-2-dates-based-on-360-days-year/m-p/309930#M66793</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a code that we are looking to automate which currently some part of it is in excel.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is basically calculating difference in dates based on an excel function day360 which calculates difference in dates based on a 360 day year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am hoping to replicate this code in SAS and I know we can use intck to calculate difference in dates, but looking for suggestions/ inputs to calculate difference in dates based on a 360 day year in SAS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate the help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tej&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 03:27:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-difference-in-2-dates-based-on-360-days-year/m-p/309930#M66793</guid>
      <dc:creator>BhararaTej</dc:creator>
      <dc:date>2016-11-08T03:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: calculate difference in 2 dates based on 360 days year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-difference-in-2-dates-based-on-360-days-year/m-p/309932#M66794</link>
      <description>&lt;P&gt;It looks like the calculation is the number of months multiplied by 30 days.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use INTNX to move the date to the end/beginning/same of an interval as required.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Was the third parameter in Excel True or False?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 03:35:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-difference-in-2-dates-based-on-360-days-year/m-p/309932#M66794</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-08T03:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: calculate difference in 2 dates based on 360 days year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-difference-in-2-dates-based-on-360-days-year/m-p/309936#M66795</link>
      <description>&lt;P&gt;You can emulate the European method with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;day360 = intck("MONTH", date_a, date_b) * 30 + 
            min(30, day(date_b)) - min(30, day(date_a));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Nov 2016 04:11:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-difference-in-2-dates-based-on-360-days-year/m-p/309936#M66795</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-11-08T04:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: calculate difference in 2 dates based on 360 days year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-difference-in-2-dates-based-on-360-days-year/m-p/309940#M66796</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc fcmp outlib=WORK.FUNC.TEST;
  function days360(END, START);
    Y=intck('year',START, END);
    N=Y*360+intck('day',START,intnx('year',END,-Y,'s'));
    return (N);
  endsub;
run;

options cmplib=WORK.FUNC;
 
data _null_;
  END   = '07dec2016'd;
  START = '8nov2014'd;
  DAYS  = days360(END, START);
  putlog DAYS=;
run;
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;DAYS=749&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 04:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-difference-in-2-dates-based-on-360-days-year/m-p/309940#M66796</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2016-11-08T04:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: calculate difference in 2 dates based on 360 days year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-difference-in-2-dates-based-on-360-days-year/m-p/309954#M66800</link>
      <description>You want calculate the number of years between two date ? Check function YRDIF(start,end,'30/360');</description>
      <pubDate>Tue, 08 Nov 2016 06:28:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-difference-in-2-dates-based-on-360-days-year/m-p/309954#M66800</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-08T06:28:53Z</dc:date>
    </item>
  </channel>
</rss>

