<?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 intck in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/intck/m-p/805771#M317408</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data test;
result1=intck("month", "14Nov2021"d, "24jan2022"d);
result3=intck("month", "7sep2021"d, "01dec2021"d);&lt;BR /&gt;result3=intck("month", "20sep2021"d, "01dec2021"d);
run;

proc print data=test;
run;&lt;/PRE&gt;
&lt;P&gt;how is the no of month calculated, is it round up or round down and where is the dividing line?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2022 03:06:19 GMT</pubDate>
    <dc:creator>HeatherNewton</dc:creator>
    <dc:date>2022-04-04T03:06:19Z</dc:date>
    <item>
      <title>intck</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck/m-p/805771#M317408</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data test;
result1=intck("month", "14Nov2021"d, "24jan2022"d);
result3=intck("month", "7sep2021"d, "01dec2021"d);&lt;BR /&gt;result3=intck("month", "20sep2021"d, "01dec2021"d);
run;

proc print data=test;
run;&lt;/PRE&gt;
&lt;P&gt;how is the no of month calculated, is it round up or round down and where is the dividing line?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 03:06:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck/m-p/805771#M317408</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-04-04T03:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: intck</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck/m-p/805772#M317409</link>
      <description>&lt;P&gt;No rounding is done with the default behaviour of the INTCK function which is to count month boundaries. In your first example&amp;nbsp;14Nov2021 to&amp;nbsp;24Jan2022, this crosses two month boundaries (1 Dec 2021 and 1 Jan 2022) so RESULT1 = 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: If you add the continuous option then the results change. Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
result1=intck("month", "14Nov2021"d, "14Jan2022"d, 'C');
result2=intck("month", "14Nov2021"d, "13Jan2022"d, 'C');
result3=intck("month", "14Nov2021"d, "15Jan2022"d, 'C');
put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS now counts complete months from the starting date. RESULT1 = 2 as 14 Nov to 14 Jan is 2 complete month intervals exactly. RESULT2 = 1 as only 1 month interval is complete. RESULT3 = 2 as it contains 2 complete month intervals - the extra day is not included.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 03:43:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck/m-p/805772#M317409</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-04-04T03:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: intck</title>
      <link>https://communities.sas.com/t5/SAS-Programming/intck/m-p/805781#M317410</link>
      <description>&lt;P&gt;From the documentation of the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p1md4mx2crzfaqn14va8kt7qvfhr.htm" target="_blank" rel="noopener"&gt;INTCK Function&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Returns the number of &lt;FONT color="#FF0000"&gt;interval boundaries&lt;/FONT&gt; of a given kind that lie between two dates, times, or datetime values.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;With an interval of MONTH, the boundary is midnight between the last day of a month and the first day of the following month.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 05:43:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/intck/m-p/805781#M317410</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-04-04T05:43:22Z</dc:date>
    </item>
  </channel>
</rss>

