<?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: Forming time groups in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Forming-time-groups/m-p/836665#M330812</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/133090"&gt;@RandyStan&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think for &lt;FONT face="courier new,courier"&gt;year &amp;gt;= 2015&lt;/FONT&gt; you want to count 25-minute intervals &lt;EM&gt;starting at &lt;FONT face="courier new,courier"&gt;'09:15:00't&lt;/FONT&gt;&lt;/EM&gt;, i.e., the first interval ends at &lt;FONT face="courier new,courier"&gt;'09:39:59't&lt;/FONT&gt;. For this you need to request the &lt;EM&gt;continuous&lt;/EM&gt; method in the fourth argument 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;PRE&gt;&lt;FONT size="4"&gt;if year &amp;gt;= 2015 then VarA = INTCK ('Minute25', '09:15:00't, time&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;, 'c'&lt;/FONT&gt;&lt;/STRONG&gt;);&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the default &lt;EM&gt;discrete&lt;/EM&gt; method the first interval boundary after &lt;FONT face="courier new,courier"&gt;'09:15:00't&lt;/FONT&gt; is between &lt;FONT face="courier new,courier"&gt;'09:34:59't&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;'09:35:00't = &lt;STRONG&gt;23*&lt;/STRONG&gt;'0:25:00't&lt;/FONT&gt;&amp;nbsp;(&lt;EM&gt;integer&lt;/EM&gt; multiple of the interval &lt;EM&gt;starting at &lt;FONT face="courier new,courier"&gt;'0:00:00't&lt;/FONT&gt;&lt;/EM&gt;). You don't have this problem for the other years because &lt;FONT face="courier new,courier"&gt;'10:00:00't&lt;/FONT&gt;&amp;nbsp;(unlike &lt;FONT face="courier new,courier"&gt;'09:15:00't&lt;/FONT&gt;) happens to be an integer multiple of &lt;FONT face="courier new,courier"&gt;'0:25:00't&lt;/FONT&gt;:&amp;nbsp;&lt;FONT face="courier new,courier"&gt;'10:00:00't = &lt;STRONG&gt;24*&lt;/STRONG&gt;'0:25:00't&lt;/FONT&gt;. So in that case the discrete and the continuous method yield the same results. For consistency and clarity you could specify the &lt;FONT face="courier new,courier"&gt;'c' &lt;/FONT&gt;argument in both cases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:&lt;/P&gt;
&lt;P&gt;Example:&amp;nbsp;The number of 25-minute intervals from 9:15 through 10:28 is ...&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;3&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;= intck('minute25','09:15't,'10:28't)&lt;/FONT&gt; by the discrete method (counting the 0:00-based interval boundaries at 9:35, 10:00 and 10:25)&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;2&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;= intck('minute25','09:15't,'10:28't,'c')&lt;/FONT&gt; by the continuous method (counting the 9:15-based interval boundaries at 9:40 and 10:05)&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;2.92&amp;nbsp;&lt;/STRONG&gt;= ('10:28't-'09:15't)/'0:25't&lt;/FONT&gt;&amp;nbsp;by measuring the time difference in units of 25 minutes rather than counting interval boundaries.&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Tue, 04 Oct 2022 11:11:07 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2022-10-04T11:11:07Z</dc:date>
    <item>
      <title>Forming time groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Forming-time-groups/m-p/836632#M330799</link>
      <description>&lt;P&gt;Dear All:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I wrote:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data want ; set have;&lt;/P&gt;&lt;P&gt;if Year &amp;lt; 2015 then VarA = INTCK ('Minute25.' , '10:00:00't , time); else&lt;/P&gt;&lt;P&gt;if year &amp;gt;= 2015 then VarA = INTCK ('Minute25.' , '09:15:00't, time) ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;I cannot get the 25 minute intervals starting at different times for the different years.&amp;nbsp; &amp;nbsp;What mistake am I making?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Randy&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 03:36:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Forming-time-groups/m-p/836632#M330799</guid>
      <dc:creator>RandyStan</dc:creator>
      <dc:date>2022-10-04T03:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Forming time groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Forming-time-groups/m-p/836643#M330804</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/133090"&gt;@RandyStan&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;does it work for the years &amp;lt; 2015?&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;Markus&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 05:40:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Forming-time-groups/m-p/836643#M330804</guid>
      <dc:creator>MarkusWeick</dc:creator>
      <dc:date>2022-10-04T05:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Forming time groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Forming-time-groups/m-p/836645#M330805</link>
      <description>&lt;P&gt;Maxim 2.&lt;/P&gt;
&lt;P&gt;Please post the complete log of your step.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 05:43:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Forming-time-groups/m-p/836645#M330805</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-10-04T05:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Forming time groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Forming-time-groups/m-p/836665#M330812</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/133090"&gt;@RandyStan&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think for &lt;FONT face="courier new,courier"&gt;year &amp;gt;= 2015&lt;/FONT&gt; you want to count 25-minute intervals &lt;EM&gt;starting at &lt;FONT face="courier new,courier"&gt;'09:15:00't&lt;/FONT&gt;&lt;/EM&gt;, i.e., the first interval ends at &lt;FONT face="courier new,courier"&gt;'09:39:59't&lt;/FONT&gt;. For this you need to request the &lt;EM&gt;continuous&lt;/EM&gt; method in the fourth argument 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;PRE&gt;&lt;FONT size="4"&gt;if year &amp;gt;= 2015 then VarA = INTCK ('Minute25', '09:15:00't, time&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;, 'c'&lt;/FONT&gt;&lt;/STRONG&gt;);&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the default &lt;EM&gt;discrete&lt;/EM&gt; method the first interval boundary after &lt;FONT face="courier new,courier"&gt;'09:15:00't&lt;/FONT&gt; is between &lt;FONT face="courier new,courier"&gt;'09:34:59't&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;'09:35:00't = &lt;STRONG&gt;23*&lt;/STRONG&gt;'0:25:00't&lt;/FONT&gt;&amp;nbsp;(&lt;EM&gt;integer&lt;/EM&gt; multiple of the interval &lt;EM&gt;starting at &lt;FONT face="courier new,courier"&gt;'0:00:00't&lt;/FONT&gt;&lt;/EM&gt;). You don't have this problem for the other years because &lt;FONT face="courier new,courier"&gt;'10:00:00't&lt;/FONT&gt;&amp;nbsp;(unlike &lt;FONT face="courier new,courier"&gt;'09:15:00't&lt;/FONT&gt;) happens to be an integer multiple of &lt;FONT face="courier new,courier"&gt;'0:25:00't&lt;/FONT&gt;:&amp;nbsp;&lt;FONT face="courier new,courier"&gt;'10:00:00't = &lt;STRONG&gt;24*&lt;/STRONG&gt;'0:25:00't&lt;/FONT&gt;. So in that case the discrete and the continuous method yield the same results. For consistency and clarity you could specify the &lt;FONT face="courier new,courier"&gt;'c' &lt;/FONT&gt;argument in both cases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:&lt;/P&gt;
&lt;P&gt;Example:&amp;nbsp;The number of 25-minute intervals from 9:15 through 10:28 is ...&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;3&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;= intck('minute25','09:15't,'10:28't)&lt;/FONT&gt; by the discrete method (counting the 0:00-based interval boundaries at 9:35, 10:00 and 10:25)&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;2&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;= intck('minute25','09:15't,'10:28't,'c')&lt;/FONT&gt; by the continuous method (counting the 9:15-based interval boundaries at 9:40 and 10:05)&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;2.92&amp;nbsp;&lt;/STRONG&gt;= ('10:28't-'09:15't)/'0:25't&lt;/FONT&gt;&amp;nbsp;by measuring the time difference in units of 25 minutes rather than counting interval boundaries.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 04 Oct 2022 11:11:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Forming-time-groups/m-p/836665#M330812</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-10-04T11:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Forming time groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Forming-time-groups/m-p/836997#M330956</link>
      <description>&lt;P&gt;Thanks much&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 16:21:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Forming-time-groups/m-p/836997#M330956</guid>
      <dc:creator>RandyStan</dc:creator>
      <dc:date>2022-10-05T16:21:08Z</dc:date>
    </item>
  </channel>
</rss>

