<?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: Format time in grouped blocks in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/566675#M159294</link>
    <description>The range worked, but instead of printing in the grouped value ("6:00am - 3:59pm"..etc). The output looks like this:&lt;BR /&gt;"1837409536.698"</description>
    <pubDate>Mon, 17 Jun 2019 18:33:22 GMT</pubDate>
    <dc:creator>lydiawawa</dc:creator>
    <dc:date>2019-06-17T18:33:22Z</dc:date>
    <item>
      <title>Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/566668#M159289</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have a time variable in the format of datetime32.4(ex: 21MAR2019:10:19:15.2970) and I'm trying to group the time into the following block such as showing in the SAS code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; proc format;
value timerng
"06:00"t -&amp;lt; "15:59"t= "6:00am - 3:59pm"
"16:00"t -&amp;lt; "21:59"t = "4:00pm - 9:59pm"
"22:00"t -&amp;lt; "05:59"t = "10:00pm - 5:59am";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I received an error message saying the start is greater than the end. Is there any other way to group the time variable into the wanted blocks?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 18:16:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/566668#M159289</guid>
      <dc:creator>lydiawawa</dc:creator>
      <dc:date>2019-06-17T18:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/566672#M159291</link>
      <description>&lt;LI-CODE lang="sas"&gt;&lt;SPAN class="token string"&gt;"22:00"&lt;/SPAN&gt;t &lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"05:59"&lt;/SPAN&gt;t &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"10:00pm - 5:59am"&lt;/SPAN&gt;&lt;/LI-CODE&gt;
&lt;P&gt;This is the problem, you can't have 05:59 is the high end of the range because it is less than 22:00&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps what you want is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
     ...
    "22:00"t-"23:59"t, "00:00"t-"05:59"t = "10:00 pm - 5:59 am";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 18:24:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/566672#M159291</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-17T18:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/566675#M159294</link>
      <description>The range worked, but instead of printing in the grouped value ("6:00am - 3:59pm"..etc). The output looks like this:&lt;BR /&gt;"1837409536.698"</description>
      <pubDate>Mon, 17 Jun 2019 18:33:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/566675#M159294</guid>
      <dc:creator>lydiawawa</dc:creator>
      <dc:date>2019-06-17T18:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/566676#M159295</link>
      <description>&lt;P&gt;Show us the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show us sample data.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 18:43:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/566676#M159295</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-17T18:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/566685#M159301</link>
      <description>You have a date time variable but created a time format. You'll need to separate the two first using TIMEPART to have your time correctly set up. Otherwise, especially if you're trying to create groups across dates you'll need a different approach. And do you need any custom calculations for daylight savings time.</description>
      <pubDate>Mon, 17 Jun 2019 18:58:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/566685#M159301</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-17T18:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/566693#M159305</link>
      <description>Thank you for the hint. Timepart() worked!</description>
      <pubDate>Mon, 17 Jun 2019 19:20:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/566693#M159305</guid>
      <dc:creator>lydiawawa</dc:creator>
      <dc:date>2019-06-17T19:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/571070#M161071</link>
      <description>&lt;P&gt;For some reason the following format does not cover the end point:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value timerng
"06:00"t - "15:59"t= "6:00am - 3:59pm: Daytime"
"16:00"t - "21:59"t= "4:00pm - 9:59pm: Evening"
"22:00"t - "23:59"t, "00:00"t - "05:59"t, = "10:00pm - 5:59am: Overnight";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I do a freq count entries with time equal to 15:59 or 21:59 are all not converted to the categorical group. Does anyone know what is the cause?&lt;/P&gt;&lt;P&gt;This is what I have in return for 9:59pm: 7919.5840001106&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 20:05:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/571070#M161071</guid>
      <dc:creator>lydiawawa</dc:creator>
      <dc:date>2019-07-03T20:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/571073#M161072</link>
      <description>That's because you have seconds so 9:59.45 seconds will not be in those intervals. Just put them at the start of the next interval and SAS will sort it out, or use the -&amp;lt;  explicitly exclude and include your endpoints.&lt;BR /&gt;&lt;BR /&gt;"06:00"t - &amp;lt; "16:00"t = ......&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#n03qskwoints2an1ispy57plwrn9.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#n03qskwoints2an1ispy57plwrn9.htm&lt;/A&gt;</description>
      <pubDate>Wed, 03 Jul 2019 20:16:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/571073#M161072</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-03T20:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/571115#M161088</link>
      <description>&lt;P&gt;+1 for the&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;-&amp;lt; operand in proc format&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 23:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/571115#M161088</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-07-03T23:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574355#M162272</link>
      <description>Sorry this still did not work.. but I created a conditional statement after dividing time variable into min and second.</description>
      <pubDate>Wed, 17 Jul 2019 20:25:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574355#M162272</guid>
      <dc:creator>lydiawawa</dc:creator>
      <dc:date>2019-07-17T20:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574366#M162276</link>
      <description>&lt;P&gt;Didn't work is vague and could mean anything from doesn't tell us if your computer disintegrated into bits or if you forgot a semicolon.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to provide more information, specifically the code you ran, the log and what isn't working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/30435"&gt;@lydiawawa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Sorry this still did not work.. but I created a conditional statement after dividing time variable into min and second.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 21:07:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574366#M162276</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-17T21:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574404#M162297</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Didn't work is vague and could mean anything from doesn't tell us if your computer disintegrated into bits or if you forgot a semicolon.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to provide more information, specifically the code you ran, the log and what isn't working.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Classic reply&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; Couldn't stop laughing.&amp;nbsp; Plus it's spot on (but still funny).&amp;nbsp; Wish I could give this 10 likes.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 00:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574404#M162297</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-07-18T00:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574412#M162302</link>
      <description>It's not intended to be mean, and I hope it doesn't come across that way, just that it's such a vague statement that conveys no information.</description>
      <pubDate>Thu, 18 Jul 2019 01:39:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574412#M162302</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-18T01:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574416#M162304</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;It's not intended to be mean, and I hope it doesn't come across that way, just that it's such a vague statement that conveys no information.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No it didn't come across as mean to me, and I hope not to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/30435"&gt;@lydiawawa&lt;/a&gt; as well.&amp;nbsp; I just thought your examples of vagueness, such as the computer disintegrating to bits, as funny.&amp;nbsp; Perhaps that's just my sense of humor.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wonder how you'd post an example of that?&amp;nbsp; Take a picture and attach it I suppose &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 01:56:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574416#M162304</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-07-18T01:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574425#M162311</link>
      <description>I just got back from work. Really didn't expect this post can be this controversial lol. Anyways, the dataset I'm dealing with is so large and it is para data. There are no errors in log, no missing semicolons. It might be the dataset is just too messy to be formatted? Thank you for the help!</description>
      <pubDate>Thu, 18 Jul 2019 02:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574425#M162311</guid>
      <dc:creator>lydiawawa</dc:creator>
      <dc:date>2019-07-18T02:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574427#M162312</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;You need to provide more information, specifically the code you ran, the log and what isn't working.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What part of this is unclear?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 02:31:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574427#M162312</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-07-18T02:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574428#M162313</link>
      <description>Code can be wrong via syntax, which the log picks up, or wrong as in logically wrong, where it doesn't do what you think it's doing or want it to do. I'm guessing you're in the latter but without the code we can't help you any further.  It's your choice on how to proceed.</description>
      <pubDate>Thu, 18 Jul 2019 02:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574428#M162313</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-18T02:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574430#M162315</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value timerng
"06:00"t -&amp;lt; "15:59"t= "6:00am - 3:59pm: Daytime"
"16:00"t -&amp;lt; "21:59"t= "4:00pm - 9:59pm: Evening"
"22:00"t -&amp;lt; "23:59"t, "00:00"t -&amp;lt; "05:59"t, = "10:00pm - 5:59am: Overnight";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I added "&amp;lt;"&amp;nbsp; next to all the slashes, but the same problem persisted.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 02:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574430#M162315</guid>
      <dc:creator>lydiawawa</dc:creator>
      <dc:date>2019-07-18T02:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574432#M162317</link>
      <description>&lt;P&gt;You never fixed the intervals. See my earlier response, which may not have been that clear, also below. Notice that ending goes to 00, not to 59. When it goes to 59, values such as 12:59.45 don't get grouped anywhere because it's not included in any of your ranges. &lt;STRONG&gt;So you need to change the ends to be the same as the beginning of the next interval AND use the exclude option to exclude it. Or put them the same and let SAS figure it out, I think the default is what you want. See the section in red below.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="lia-message-heading lia-component-message-header"&gt;
&lt;DIV class="lia-quilt-row lia-quilt-row-standard"&gt;
&lt;DIV class="lia-quilt-column lia-quilt-column-20 lia-quilt-column-left"&gt;
&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-left"&gt;
&lt;DIV class="lia-message-subject"&gt;
&lt;H2&gt;Re: Format time in grouped blocks&lt;/H2&gt;
&lt;DIV class="MessageReadByModeratorCell lia-moderation-moderated"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="lia-quilt-column lia-quilt-column-04 lia-quilt-column-right"&gt;
&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-right"&gt;
&lt;DIV class="lia-message-options"&gt;
&lt;DIV id="actionMenuDropDown_7" class="lia-menu-navigation-wrapper lia-menu-action message-menu"&gt;
&lt;DIV class="lia-menu-navigation"&gt;
&lt;DIV class="dropdown-default-item"&gt;&lt;A id="dropDownLink_7" class="lia-js-menu-opener default-menu-option lia-js-click-menu lia-link-navigation" title="Show option menu" role="button" href="#" aria-haspopup="true" aria-expanded="false" aria-label="Show option menu" target="_blank"&gt;Options&lt;/A&gt;
&lt;DIV class="dropdown-positioning"&gt;
&lt;DIV class="dropdown-positioning-static"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="reply-to-stamp"&gt;&lt;SPAN class="reply-author"&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/571070#M161071" target="_blank"&gt;Posted in reply to&lt;/A&gt; &lt;SPAN title="Message from 2019-07-03"&gt;lydiawawa&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P class="lia-message-dates lia-message-post-date lia-component-post-date-last-edited"&gt;&lt;SPAN class="DateTime lia-message-posted-on lia-component-common-widget-date"&gt;&lt;SPAN class="local-date"&gt;‎2019-07-03&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;04:16 PM&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV id="messagebodydisplay_0_6" class="lia-message-body lia-component-body"&gt;
&lt;DIV class="lia-message-body-content"&gt;That's because you have seconds so 9:59.45 seconds will not be in those intervals. &lt;STRONG&gt;Just put them at the start of the next interval and SAS will sort it out, or use the -&amp;lt; explicitly exclude and include your endpoints.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;"06:00"t - &amp;lt; "16:00"t&lt;/STRONG&gt; &lt;/FONT&gt;= ......&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#n03qskwoints2an1ispy57plwrn9.htm" target="_blank" rel="nofollow noopener noreferrer"&gt;http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#n03qskwoints2an1ispy5...&lt;/A&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 Jul 2019 02:46:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574432#M162317</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-18T02:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Format time in grouped blocks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574433#M162318</link>
      <description>&lt;P&gt;Review this and tell us which observation numbers are incorrect:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   do time="00:00:00"t to "23:59:59"t;
      output;
   end;
   format time time.;
run;

proc format;
   value timerng
      "06:00:00"t -&amp;lt; "16:00:00"t  = "6:00am - 3:59pm: Daytime"
      "16:00:00"t -&amp;lt; "22:00:00"t  = "4:00pm - 9:59pm: Evening"
      "22:00:00"t -  "23:59:59"t, 
      "00:00:00"t -&amp;lt; "06:00:00"t  = "10:00pm - 5:59am: Overnight";
run;

data want;
   set have;
   time2=put(time,timerng.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Jul 2019 02:47:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-time-in-grouped-blocks/m-p/574433#M162318</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-07-18T02:47:10Z</dc:date>
    </item>
  </channel>
</rss>

