<?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 How to round up a date to nearest second in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-round-up-a-date-to-nearest-second/m-p/175437#M45025</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What function can I use to change:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2014-07-09 11:42:34:826&amp;nbsp; --&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2014-07-09 11:42:35:000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e&amp;nbsp; round the millisecond to the nearest second and put 000 in the millisecond portion. I need to use the rounded value in a join condition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jul 2014 18:44:53 GMT</pubDate>
    <dc:creator>eagles_dare13</dc:creator>
    <dc:date>2014-07-10T18:44:53Z</dc:date>
    <item>
      <title>How to round up a date to nearest second</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-round-up-a-date-to-nearest-second/m-p/175437#M45025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What function can I use to change:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2014-07-09 11:42:34:826&amp;nbsp; --&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2014-07-09 11:42:35:000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e&amp;nbsp; round the millisecond to the nearest second and put 000 in the millisecond portion. I need to use the rounded value in a join condition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 18:44:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-round-up-a-date-to-nearest-second/m-p/175437#M45025</guid>
      <dc:creator>eagles_dare13</dc:creator>
      <dc:date>2014-07-10T18:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to round up a date to nearest second</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-round-up-a-date-to-nearest-second/m-p/175438#M45026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the milliseconds come from the decimal point so try rounding to the nearest digit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;round(time, 1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 19:20:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-round-up-a-date-to-nearest-second/m-p/175438#M45026</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-07-10T19:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to round up a date to nearest second</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-round-up-a-date-to-nearest-second/m-p/175439#M45027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello eagles_dare13,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your input data is consistently the same length (23 characters) and formatted as your example data, maybe try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile datalines delimiter=',';&lt;/P&gt;&lt;P&gt;&amp;nbsp; format&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt $23.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input dt;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;2014-07-09 11:42:34:826&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt2 e8601dt23.3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; substr(dt,20,1)='.';&lt;/P&gt;&lt;P&gt;&amp;nbsp; put dt=;&lt;/P&gt;&lt;P&gt;&amp;nbsp; dt2=input(dt,e8601dt23.3);&lt;/P&gt;&lt;P&gt;&amp;nbsp; dt2=ceil(dt2);&lt;/P&gt;&lt;P&gt;&amp;nbsp; put dt2=;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 20:36:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-round-up-a-date-to-nearest-second/m-p/175439#M45027</guid>
      <dc:creator>JasonAllen</dc:creator>
      <dc:date>2014-07-10T20:36:36Z</dc:date>
    </item>
  </channel>
</rss>

