<?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 change character timestamp to numeric data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/change-character-timestamp-to-numeric-data/m-p/679871#M205346</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a date variable that looks like the following:&lt;/P&gt;
&lt;P&gt;2020-08-26 09:16:36 and it is a character&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran the following code to try and convert the code to mmddyy10. format but it is not working.&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;ps_ts= substr(patient_survey_timestamp, 1, 10);&lt;BR /&gt;pat_suv_date = input(ps_ts, mmddyy10.);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obviously, I am applying the code incorrectly, does anyone know the correct way to run this code? Thank you&lt;/P&gt;</description>
    <pubDate>Thu, 27 Aug 2020 18:54:00 GMT</pubDate>
    <dc:creator>GS2</dc:creator>
    <dc:date>2020-08-27T18:54:00Z</dc:date>
    <item>
      <title>change character timestamp to numeric data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-character-timestamp-to-numeric-data/m-p/679871#M205346</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a date variable that looks like the following:&lt;/P&gt;
&lt;P&gt;2020-08-26 09:16:36 and it is a character&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran the following code to try and convert the code to mmddyy10. format but it is not working.&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;ps_ts= substr(patient_survey_timestamp, 1, 10);&lt;BR /&gt;pat_suv_date = input(ps_ts, mmddyy10.);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obviously, I am applying the code incorrectly, does anyone know the correct way to run this code? Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 18:54:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-character-timestamp-to-numeric-data/m-p/679871#M205346</guid>
      <dc:creator>GS2</dc:creator>
      <dc:date>2020-08-27T18:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: change character timestamp to numeric data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-character-timestamp-to-numeric-data/m-p/679872#M205347</link>
      <description>&lt;P&gt;If you only want the date part of the value read with the correct informat.&lt;/P&gt;
&lt;P&gt;one way&lt;/P&gt;
&lt;PRE&gt;data example;
   x="2020-08-26 09:16:36";
   date = input(x,yymmdd10.);
   format date mmddyy10.;
run;&lt;/PRE&gt;
&lt;P&gt;The value of the date portion of the string is in year month day order. Whey you use MMDDYY for the informat then you are reading month day year.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 18:59:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-character-timestamp-to-numeric-data/m-p/679872#M205347</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-08-27T18:59:27Z</dc:date>
    </item>
  </channel>
</rss>

