<?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: concatenating two separate fields (date and time) into one datetime field in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/concatenating-two-separate-fields-date-and-time-into-one/m-p/135309#M10987</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great - that worked, except that SAS couldn't find the hhmmss format - I changed it to hhmm8. and then it worked like a charm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't even think about the attrib - have rarely used it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jul 2014 15:01:56 GMT</pubDate>
    <dc:creator>DianeAnna</dc:creator>
    <dc:date>2014-07-24T15:01:56Z</dc:date>
    <item>
      <title>concatenating two separate fields (date and time) into one datetime field</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/concatenating-two-separate-fields-date-and-time-into-one/m-p/135307#M10985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two separate fields - one a date and one a time - that I need to concatenate together into one long datetime field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date field is a numeric field, currently in the YYYY-MM-DD format (2014-07-24 for example) and the time field is numeric in the HH:MM:SS format (9:23:00 or 11:35:00 for example - the leading 0 is not there for half of the time).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to get these two separate fields into a format that looks like:&amp;nbsp; 01NOV13:09:23:00 - the date has a length of 7, the time has a length of 8 and there is a colon between them. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried formatting both fields, then concatenating, then formatting the concatenated field, and no such luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 14:40:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/concatenating-two-separate-fields-date-and-time-into-one/m-p/135307#M10985</guid>
      <dc:creator>DianeAnna</dc:creator>
      <dc:date>2014-07-24T14:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating two separate fields (date and time) into one datetime field</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/concatenating-two-separate-fields-date-and-time-into-one/m-p/135308#M10986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;attrib newdate format=datetime15.;&lt;/P&gt;&lt;P&gt;newdate=input(put(date,date7.)||put(time,hhmmss.),datetime.);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 14:51:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/concatenating-two-separate-fields-date-and-time-into-one/m-p/135308#M10986</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-24T14:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating two separate fields (date and time) into one datetime field</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/concatenating-two-separate-fields-date-and-time-into-one/m-p/135309#M10987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great - that worked, except that SAS couldn't find the hhmmss format - I changed it to hhmm8. and then it worked like a charm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't even think about the attrib - have rarely used it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 15:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/concatenating-two-separate-fields-date-and-time-into-one/m-p/135309#M10987</guid>
      <dc:creator>DianeAnna</dc:creator>
      <dc:date>2014-07-24T15:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating two separate fields (date and time) into one datetime field</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/concatenating-two-separate-fields-date-and-time-into-one/m-p/135310#M10988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since your date and time are numeric, another option is to use &lt;SPAN class="keyword"&gt;DHMS function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="syntax"&gt;&lt;DIV class="syntaxSimple"&gt;&lt;DIV class="syntaxLevel"&gt;newdtm=dhms(date, 0,0,time);&lt;/DIV&gt;&lt;DIV class="syntaxLevel"&gt; &lt;/DIV&gt;&lt;DIV class="syntaxLevel"&gt;Haikuo &lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 15:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/concatenating-two-separate-fields-date-and-time-into-one/m-p/135310#M10988</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-07-24T15:02:16Z</dc:date>
    </item>
  </channel>
</rss>

