<?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 change text datetime variable to be SAS datetime format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-text-datetime-variable-to-be-SAS-datetime-format/m-p/466631#M119079</link>
    <description>Did you try anydtdtm. informat for the WordDate, or a worddate informat, if it exists?</description>
    <pubDate>Thu, 31 May 2018 20:34:25 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-05-31T20:34:25Z</dc:date>
    <item>
      <title>How to change text datetime variable to be SAS datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-text-datetime-variable-to-be-SAS-datetime-format/m-p/466629#M119077</link>
      <description>&lt;P&gt;I have one of the data field SENT_DATE='&amp;nbsp;Wednesday, September 06, 2017 10:14 PM' and '2017-07-14 13:01:00.0'. I am using&lt;/P&gt;&lt;P&gt;sent_date1=input(sent_date, e8601dt19.) and format sent_date1 datetime19.all the '2017-07-14 13:01:00.0' to be SAS datetime format. However it can't change the ' Wednesday, September 06, 2017 10:14 PM'.&amp;nbsp; I tried different ways, it failed. How to deal with it?&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 20:28:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-text-datetime-variable-to-be-SAS-datetime-format/m-p/466629#M119077</guid>
      <dc:creator>georgiaf</dc:creator>
      <dc:date>2018-05-31T20:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to change text datetime variable to be SAS datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-text-datetime-variable-to-be-SAS-datetime-format/m-p/466631#M119079</link>
      <description>Did you try anydtdtm. informat for the WordDate, or a worddate informat, if it exists?</description>
      <pubDate>Thu, 31 May 2018 20:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-text-datetime-variable-to-be-SAS-datetime-format/m-p/466631#M119079</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-31T20:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to change text datetime variable to be SAS datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-text-datetime-variable-to-be-SAS-datetime-format/m-p/466657#M119089</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
do txt = 
    "Wednesday, September 06, 2017 10:14 PM",
    "2017-07-14 13:01:00.0";
    if anydigit(first(txt)) then 
         date = input(txt, e8601dt19.);
    else date = input(prxchange("s/\s*\w+,\s*//o",1,txt), anydtdtm40.);
    output;
    end;
format date datetime19.;
run;

proc print; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 May 2018 22:25:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-text-datetime-variable-to-be-SAS-datetime-format/m-p/466657#M119089</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-05-31T22:25:23Z</dc:date>
    </item>
  </channel>
</rss>

