<?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: DateTime Threshold in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DateTime-Threshold/m-p/261010#M310110</link>
    <description>&lt;P&gt;Well, I have noting to work with here, but at a guess:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table WANT as
  select   case when timepart(DATETIME_VAR) &amp;lt; "08:00"t then 
                        input(put(datepart(DATETIME_VAR)||"T08:00:00",datetime.)
                     else DATETIME_VAR as RESULT format=datetime.
  from     HAVE;
quit;&lt;/PRE&gt;</description>
    <pubDate>Mon, 04 Apr 2016 08:27:05 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-04-04T08:27:05Z</dc:date>
    <item>
      <title>DateTime Threshold</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DateTime-Threshold/m-p/261005#M310109</link>
      <description>&lt;P&gt;I am doing a case statement in SAS and want all date time variables below dd-mmm-yyyy 08:00:00 to have time set as 08:00:00 for one day and 09:00:00 for another day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an easy way to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 08:13:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DateTime-Threshold/m-p/261005#M310109</guid>
      <dc:creator>mk131190</dc:creator>
      <dc:date>2016-04-04T08:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime Threshold</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DateTime-Threshold/m-p/261010#M310110</link>
      <description>&lt;P&gt;Well, I have noting to work with here, but at a guess:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table WANT as
  select   case when timepart(DATETIME_VAR) &amp;lt; "08:00"t then 
                        input(put(datepart(DATETIME_VAR)||"T08:00:00",datetime.)
                     else DATETIME_VAR as RESULT format=datetime.
  from     HAVE;
quit;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Apr 2016 08:27:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DateTime-Threshold/m-p/261010#M310110</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-04T08:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime Threshold</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DateTime-Threshold/m-p/261037#M310111</link>
      <description>&lt;P&gt;Sorry further understanding below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CASE WHEN timepart(a.date) &amp;lt; '08:00:00't AND put(a.date,weekdate3.) IN ('MON','TUE','WED','THU','FRI')&lt;BR /&gt;THEN&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;WHEN &lt;SPAN&gt;timepart&lt;/SPAN&gt;(a.date) &amp;lt; &lt;SPAN&gt;09:00:00't&lt;/SPAN&gt; AND put(a.date,weekdate3.) = 'SAT'&amp;nbsp;&lt;/P&gt;&lt;P&gt;THEN&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WHEN &lt;SPAN&gt;timepart&lt;/SPAN&gt;&lt;SPAN&gt;(a.date) &lt;/SPAN&gt;&amp;lt; 10&lt;SPAN&gt;:00:00't&lt;/SPAN&gt; AND put(a.date,weekdate3.)&amp;nbsp;= 'SUN'&amp;nbsp;&lt;BR /&gt;THEN&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ELSE&amp;nbsp;date&lt;BR /&gt;END AS&amp;nbsp;date2&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 10:19:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DateTime-Threshold/m-p/261037#M310111</guid>
      <dc:creator>mk131190</dc:creator>
      <dc:date>2016-04-04T10:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime Threshold</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DateTime-Threshold/m-p/261038#M310112</link>
      <description>&lt;P&gt;You already have all the code there, just put it together:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;case when timepart(a.date) &amp;lt; '08:00:00't and put(a.date,weekdate3.) in ('MON','TUE','WED','THU','FRI')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;       then&amp;nbsp;&lt;/SPAN&gt;input(put(datepart(DATETIME_VAR)||"T08:00:00",date&lt;WBR /&gt;time.)&lt;BR /&gt;     when ...&lt;BR /&gt;     else ... end as DATE2&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 10:22:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DateTime-Threshold/m-p/261038#M310112</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-04T10:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: DateTime Threshold</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DateTime-Threshold/m-p/261143#M310113</link>
      <description>&lt;P&gt;Consider&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Weekday(a.date) in (2:6)&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;Weekday(a.date) = 1 (sunday) or 7 (saturday)&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 17:26:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DateTime-Threshold/m-p/261143#M310113</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-04-04T17:26:19Z</dc:date>
    </item>
  </channel>
</rss>

