<?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: how to update datetime column in sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-update-datetime-column-in-sas/m-p/847235#M334972</link>
    <description>&lt;P&gt;One obvious issue: you have a datetime variable, but the function dhms expects a date as first argument.&lt;/P&gt;
&lt;P&gt;Using a data step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  date_mod = dhms(datepart(date_mod), 23, 59, 59);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Dec 2022 12:06:42 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2022-12-01T12:06:42Z</dc:date>
    <item>
      <title>how to update datetime column in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-update-datetime-column-in-sas/m-p/847234#M334971</link>
      <description>&lt;P&gt;I have a table in sas with a date column named DATE_MOD of format DATETIME23.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dates are as such:&lt;/P&gt;&lt;P&gt;28JAN2019&lt;FONT color="#FF0000"&gt;:14:32:42&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;03JUN2021:&lt;FONT color="#FF0000"&gt;14:22:13&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;04JUN2021:&lt;FONT color="#FF0000"&gt;16:02:23&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I want to change the times in red and make them &lt;FONT color="#FF0000"&gt;23:59:59&amp;nbsp;&lt;FONT color="#000000"&gt;for&lt;STRONG&gt; all the rows&lt;/STRONG&gt; in this column&amp;nbsp;like so:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;28JAN2019:&lt;FONT color="#FF0000"&gt;23:59:59&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;03JUN2021:&lt;FONT color="#FF0000"&gt;23:59:59&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;04JUN2021:&lt;FONT color="#FF0000"&gt;23:59:59&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use a proc sql update statement but it does not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sql;
update operation 
set date_mod = dhms(date_mod,23,59,59);
quit;&lt;/PRE&gt;&lt;P&gt;Any help please?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 11:56:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-update-datetime-column-in-sas/m-p/847234#M334971</guid>
      <dc:creator>MILKYLOVE</dc:creator>
      <dc:date>2022-12-01T11:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to update datetime column in sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-update-datetime-column-in-sas/m-p/847235#M334972</link>
      <description>&lt;P&gt;One obvious issue: you have a datetime variable, but the function dhms expects a date as first argument.&lt;/P&gt;
&lt;P&gt;Using a data step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  date_mod = dhms(datepart(date_mod), 23, 59, 59);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Dec 2022 12:06:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-update-datetime-column-in-sas/m-p/847235#M334972</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-12-01T12:06:42Z</dc:date>
    </item>
  </channel>
</rss>

