<?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: Split a date in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Split-a-date/m-p/671460#M79255</link>
    <description>What's your data type and format on that column?&lt;BR /&gt;&lt;BR /&gt;If it's a datetime you can likely use the HOUR() function.</description>
    <pubDate>Wed, 22 Jul 2020 16:42:18 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-07-22T16:42:18Z</dc:date>
    <item>
      <title>Split a date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Split-a-date/m-p/671453#M79252</link>
      <description>&lt;P&gt;Good afternoon,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a column within my dataset called "file_accepted". A sample record shows as "&lt;SPAN&gt;09MAR2007:16:12:21".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I am trying to create a field that grabs the 2 digits after the first colon, in this example the 16... which is military time for 4pm. Ideally, I would like my new field to be coded as "1" if the time is at 4PM or after, and "0" if the time is before 4PM.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 16:26:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Split-a-date/m-p/671453#M79252</guid>
      <dc:creator>anweinbe</dc:creator>
      <dc:date>2020-07-22T16:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Split a date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Split-a-date/m-p/671458#M79253</link>
      <description>&lt;P&gt;What type of variable, character or numeric? If the variable is a SAS datetime value, numeric with a format of DATETIME18 or similar then you can check the Hour of the value with the hour function:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; newvar = (Hour(file_accepted) ge 16);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it isn't a datetime value then you really should make a datetime valued version as most of the steps involving comparisons, selections or other manipulations of datetimes start with that conversion.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 16:35:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Split-a-date/m-p/671458#M79253</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-22T16:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Split a date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Split-a-date/m-p/671459#M79254</link>
      <description>That did it! Thank you!!!</description>
      <pubDate>Wed, 22 Jul 2020 16:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Split-a-date/m-p/671459#M79254</guid>
      <dc:creator>anweinbe</dc:creator>
      <dc:date>2020-07-22T16:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Split a date</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Split-a-date/m-p/671460#M79255</link>
      <description>What's your data type and format on that column?&lt;BR /&gt;&lt;BR /&gt;If it's a datetime you can likely use the HOUR() function.</description>
      <pubDate>Wed, 22 Jul 2020 16:42:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Split-a-date/m-p/671460#M79255</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-22T16:42:18Z</dc:date>
    </item>
  </channel>
</rss>

