<?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: intck day365 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/intck-day365/m-p/268341#M53110</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12567"&gt;@vandhan﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As to the why: I found the explanation in section "Multi-Unit Intervals" of the documentation &lt;A href="http://support.sas.com/documentation/cdl//en/lrcon/68089/HTML/default/viewer.htm#p0g056g35ez8son1sfavozh0lfb3.htm#n0ne5co6fohrian1l3fpzzdgij73" target="_blank"&gt;About Date and Time Intervals:&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"For all multi-unit intervals except multi-week intervals, SAS creates an interval beginning on January 1, 1960, and counts forward from that date to determine where individual intervals begin on the calendar."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Together with the fact that the default "method" (the&amp;nbsp;last, optional&amp;nbsp;argument) of &lt;A href="http://support.sas.com/documentation/cdl/en/syntaxidx/68719/HTML/default/index.htm#/documentation/cdl//en/lefunctionsref/67960/HTML/default/p1md4mx2crzfaqn14va8kt7qvfhr.htm" target="_blank"&gt;INTCK&lt;/A&gt; is "DISCRETE", this means that the result is obtained by counting the &lt;EM&gt;interval boundaries&lt;/EM&gt; between start date and end date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obviously, as&amp;nbsp;'19dec2010'd - '31dec2009'd = 353 &amp;lt;= 365, there can be &lt;EM&gt;at most one&lt;/EM&gt; boundary of consecutive 365-days intervals (regardless of where they start) between the two dates.&lt;/P&gt;
&lt;PRE&gt;'19dec2010'd = 18615 = 51*365&lt;/PRE&gt;
&lt;P&gt;Since January 1, 1960, is SAS day 0, the above equation means that (&lt;EM&gt;the&lt;/EM&gt;) one interval boundary is the boundary between&amp;nbsp;the days 18 Dec 2010 and 19 Dec 2010. Hence&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;intck('day365','31dec2009'd,'19dec2010'd)=1&lt;/FONT&gt;, whereas&amp;nbsp;&lt;FONT face="courier new,courier"&gt;intck('day365','31dec2009'd,'&lt;STRONG&gt;18&lt;/STRONG&gt;dec2010'd)=&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The "discrepancy" 365 - 353 = 12 reflects just the number of leap years &lt;EM&gt;after&lt;/EM&gt; 1960 up until 2010. (The first of those fifty-one 365-days intervals ended on 30 Dec 1960, so that the first incrementation of the count occurs with '31Dec1960'd.)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The good thing about the &lt;EM&gt;CONTINUOUS&lt;/EM&gt; method suggested by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32"&gt;@BrunoMueller﻿&lt;/a&gt;&amp;nbsp;is that the "interval is shifted based on the starting date" (INTCK documentation) and not based on the arbitrary 1 Jan 1960.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 04 May 2016 18:17:58 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2016-05-04T18:17:58Z</dc:date>
    <item>
      <title>intck day365</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-day365/m-p/268242#M53081</link>
      <description>&lt;P&gt;data _null_;&lt;BR /&gt;days365=intck('day365','31dec2009'd,'19dec2010'd);&lt;BR /&gt;put days365 = ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;results : day365 =&amp;nbsp;1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why 1 is coming. since intervel is not 365. it should be come as 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone explain pls.&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2016 11:12:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-day365/m-p/268242#M53081</guid>
      <dc:creator>vandhan</dc:creator>
      <dc:date>2016-05-04T11:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: intck day365</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-day365/m-p/268254#M53085</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As to the why, I do not know. However if you change your code to use the CONTINUOUS method, it should work as you expect. The CONTINUOUS sets that starting date as the beginning of the interval. See also the &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p1md4mx2crzfaqn14va8kt7qvfhr.htm" target="_blank"&gt;INTCK&lt;/A&gt; function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  days365=intck('day365', '31dec2009'd, '19dec2010'd, "CONTINUOUS");
  put days365 =;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2016 12:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-day365/m-p/268254#M53085</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-05-04T12:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: intck day365</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-day365/m-p/268266#M53086</link>
      <description>Thanks a lot bro&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Wed, 04 May 2016 13:14:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-day365/m-p/268266#M53086</guid>
      <dc:creator>vandhan</dc:creator>
      <dc:date>2016-05-04T13:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: intck day365</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck-day365/m-p/268341#M53110</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12567"&gt;@vandhan﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As to the why: I found the explanation in section "Multi-Unit Intervals" of the documentation &lt;A href="http://support.sas.com/documentation/cdl//en/lrcon/68089/HTML/default/viewer.htm#p0g056g35ez8son1sfavozh0lfb3.htm#n0ne5co6fohrian1l3fpzzdgij73" target="_blank"&gt;About Date and Time Intervals:&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"For all multi-unit intervals except multi-week intervals, SAS creates an interval beginning on January 1, 1960, and counts forward from that date to determine where individual intervals begin on the calendar."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Together with the fact that the default "method" (the&amp;nbsp;last, optional&amp;nbsp;argument) of &lt;A href="http://support.sas.com/documentation/cdl/en/syntaxidx/68719/HTML/default/index.htm#/documentation/cdl//en/lefunctionsref/67960/HTML/default/p1md4mx2crzfaqn14va8kt7qvfhr.htm" target="_blank"&gt;INTCK&lt;/A&gt; is "DISCRETE", this means that the result is obtained by counting the &lt;EM&gt;interval boundaries&lt;/EM&gt; between start date and end date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obviously, as&amp;nbsp;'19dec2010'd - '31dec2009'd = 353 &amp;lt;= 365, there can be &lt;EM&gt;at most one&lt;/EM&gt; boundary of consecutive 365-days intervals (regardless of where they start) between the two dates.&lt;/P&gt;
&lt;PRE&gt;'19dec2010'd = 18615 = 51*365&lt;/PRE&gt;
&lt;P&gt;Since January 1, 1960, is SAS day 0, the above equation means that (&lt;EM&gt;the&lt;/EM&gt;) one interval boundary is the boundary between&amp;nbsp;the days 18 Dec 2010 and 19 Dec 2010. Hence&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;intck('day365','31dec2009'd,'19dec2010'd)=1&lt;/FONT&gt;, whereas&amp;nbsp;&lt;FONT face="courier new,courier"&gt;intck('day365','31dec2009'd,'&lt;STRONG&gt;18&lt;/STRONG&gt;dec2010'd)=&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The "discrepancy" 365 - 353 = 12 reflects just the number of leap years &lt;EM&gt;after&lt;/EM&gt; 1960 up until 2010. (The first of those fifty-one 365-days intervals ended on 30 Dec 1960, so that the first incrementation of the count occurs with '31Dec1960'd.)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The good thing about the &lt;EM&gt;CONTINUOUS&lt;/EM&gt; method suggested by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32"&gt;@BrunoMueller﻿&lt;/a&gt;&amp;nbsp;is that the "interval is shifted based on the starting date" (INTCK documentation) and not based on the arbitrary 1 Jan 1960.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2016 18:17:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck-day365/m-p/268341#M53110</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-05-04T18:17:58Z</dc:date>
    </item>
  </channel>
</rss>

