<?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: Replace date value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Replace-date-value/m-p/281401#M57067</link>
    <description>&lt;P&gt;At least in SAS 9.2, the anydtdtm format coughed up with that string, so I resorted to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
char_var = '19700101 01:00:00';
date_var = dhms(
  input(substr(char_var,1,8),yymmdd8.),
  input(substr(char_var,10,2),2.),
  input(substr(char_var,13,2),2.),
  input(substr(char_var,16,2),2.)
);
format date_var e8601dt19.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The ISO 8601 format looks almost like that what the OP wanted.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jun 2016 11:49:30 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-06-30T11:49:30Z</dc:date>
    <item>
      <title>Replace date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-date-value/m-p/281393#M57062</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to look at the date value below&lt;/P&gt;&lt;P&gt;Please let me know how to change the date format as it has char type&lt;/P&gt;&lt;P&gt;source&lt;/P&gt;&lt;P&gt;19700101 01:00:00&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Target&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1970-01-01 01:00:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 11:12:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-date-value/m-p/281393#M57062</guid>
      <dc:creator>goms</dc:creator>
      <dc:date>2016-06-30T11:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Replace date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-date-value/m-p/281396#M57064</link>
      <description>&lt;P&gt;You would typically use input but I'm not sure your date is in a format SAS will recognize.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date_var = input(char_var, anydtdtm.);&lt;/P&gt;
&lt;P&gt;fomat date_var datetime21.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that doesn't work you'll have to separately input each portion, date and time, and then stitch them together again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 11:25:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-date-value/m-p/281396#M57064</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-30T11:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Replace date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-date-value/m-p/281401#M57067</link>
      <description>&lt;P&gt;At least in SAS 9.2, the anydtdtm format coughed up with that string, so I resorted to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
char_var = '19700101 01:00:00';
date_var = dhms(
  input(substr(char_var,1,8),yymmdd8.),
  input(substr(char_var,10,2),2.),
  input(substr(char_var,13,2),2.),
  input(substr(char_var,16,2),2.)
);
format date_var e8601dt19.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The ISO 8601 format looks almost like that what the OP wanted.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 11:49:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-date-value/m-p/281401#M57067</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-06-30T11:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Replace date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-date-value/m-p/281402#M57068</link>
      <description>&lt;P&gt;Thank u so much. its really helpful&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 11:53:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-date-value/m-p/281402#M57068</guid>
      <dc:creator>goms</dc:creator>
      <dc:date>2016-06-30T11:53:21Z</dc:date>
    </item>
  </channel>
</rss>

