<?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 Function and Rounding in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169399#M43799</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="815014" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: Joe, correct, but still just counting boundaries crossed.&amp;nbsp; Interestingly, the documentation is wrong.&amp;nbsp; It states that using 'C' causes the function to begin with your start date.&amp;nbsp; Actually, it appears to be "your start date or, if a datetime is provided, the starting date/time".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; hours=intck('hour','01jan2009:23:59:59'dt,'02jan2009:00:00:00'dt,'C');&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;produces 0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Dec 2013 20:25:33 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2013-12-11T20:25:33Z</dc:date>
    <item>
      <title>INTCK Function and Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169391#M43791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone out there know how the INTCK function rounds when calculating hours between two datetimes? I've tried determing by looking at results of using it, but it's not clear. For example, if five mintues has gone by it shows 0,&amp;nbsp; but if 45 have gone by it shows 1. Is it rounding at the 30 minute mark?&amp;nbsp; No guesses please this is for work so I need a concrete answer if anyone has one. Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 22:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169391#M43791</guid>
      <dc:creator>steinman</dc:creator>
      <dc:date>2013-12-10T22:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function and Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169392#M43792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to the documentation it isn't rounding at all but, rather, simply counting the number of boundaries.&amp;nbsp; Thus, if you are using it for hours, 9:59 to 10:00 would result in 1.&amp;nbsp; You can easily test that to be certain that is the way it is functioning.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 22:37:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169392#M43792</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-12-10T22:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function and Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169393#M43793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought it only counted full hours:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test ;&lt;/P&gt;&lt;P&gt;hours=intck('hour','01jan2009:00:00:00'dt,'01jan2009:00:45:00'dt); &lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;equals 0 when I run it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 22:39:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169393#M43793</guid>
      <dc:creator>SteveNZ</dc:creator>
      <dc:date>2013-12-10T22:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function and Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169394#M43794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The default method of calculation in INTCK counts the number of crossed interval boundaries between two datetimes. For example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;D1 = '14:00:00't;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;D2 = '14:59:00't;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;D3 = '15:00:00't;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;D1_D2 = intck("HOUR", D1, D2);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;D1_D3 = intck("HOUR", D1, D3);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;D2_D3 = intck("HOUR", D2, D3);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;put (D1 D2) (=:time5.) D1_D2= "No hour interval boundary crossed";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;put (D1 D3) (=:time5.) D1_D3= "15:00 hour boundary crossed";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;put (D2 D3) (=:time5.) D2_D3= "15:00 hour boundary crossed";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #0000ff;"&gt;D1=14:00 D2=14:59 D1_D2=0 No hour interval boundary crossed&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #0000ff;"&gt;D1=14:00 D3=15:00 D1_D3=1 15:00 hour boundary crossed&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #0000ff;"&gt;D2=14:59 D3=15:00 D2_D3=1 15:00 hour boundary crossed&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read the documentation for another method it can use to count boundaries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 22:45:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169394#M43794</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-12-10T22:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function and Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169395#M43795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Boundaries, not hours per se.&amp;nbsp; Try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; hours=intck('hour','01jan2009:23:59:59'dt,'02jan2009:00:00:00'dt);&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hours will result in a value of 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 22:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169395#M43795</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-12-10T22:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function and Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169396#M43796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahh I see&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 22:52:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169396#M43796</guid>
      <dc:creator>SteveNZ</dc:creator>
      <dc:date>2013-12-10T22:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function and Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169397#M43797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks everyone. I've checked this out with my data and it matches up, it is in fact just counting the difference between the hour boundaries. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 14:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169397#M43797</guid>
      <dc:creator>steinman</dc:creator>
      <dc:date>2013-12-11T14:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function and Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169398#M43798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note that if you use 'C' argument at the end, it will count continuously rather than across boundaries.&amp;nbsp; (This is what PGStats was obliquely referring to.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 19:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169398#M43798</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2013-12-11T19:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function and Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169399#M43799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="815014" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: Joe, correct, but still just counting boundaries crossed.&amp;nbsp; Interestingly, the documentation is wrong.&amp;nbsp; It states that using 'C' causes the function to begin with your start date.&amp;nbsp; Actually, it appears to be "your start date or, if a datetime is provided, the starting date/time".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; hours=intck('hour','01jan2009:23:59:59'dt,'02jan2009:00:00:00'dt,'C');&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;produces 0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 20:25:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169399#M43799</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-12-11T20:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: INTCK Function and Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169400#M43800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure what the problem is, there.&amp;nbsp; That's what you'd expect from that (perhaps the doc can be more clear, certainly).&amp;nbsp; With continuous, it's counting boundaries, true, but how else would you calculate the number of days between something?&amp;nbsp; You'd have to do some sort of boundary.&amp;nbsp; The point with continuous (which is horribly named; INTNX 'same'/'s' makes far more sense) is that it counts truly the number of [whatevers] since [exact date or datetime], not the number of crossings of an unrelated boundary (ie, midnight, or Jan 1, or whatnot.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 20:33:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/INTCK-Function-and-Rounding/m-p/169400#M43800</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2013-12-11T20:33:19Z</dc:date>
    </item>
  </channel>
</rss>

