<?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: $50. chardate to date format in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/50-chardate-to-date-format/m-p/691259#M37287</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 Date_char = '22-SEP-20';
run;

data want;
 set have;
 sas_date=input(date_char,date9.);/*read and convert to num date*/
 format sas_date date9.;/*format the sas date for appropriate display*/
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 13 Oct 2020 13:56:15 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2020-10-13T13:56:15Z</dc:date>
    <item>
      <title>$50. chardate to date format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/50-chardate-to-date-format/m-p/691257#M37286</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have a date character variable in my dataset that has the following format:&lt;BR /&gt;type = Char&lt;BR /&gt;Len = 50&lt;BR /&gt;Format = $50.&lt;BR /&gt;&lt;BR /&gt;Example of field below:&lt;/P&gt;&lt;P&gt;Date_char =&amp;nbsp;22-SEP-20&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have tried a number of functions (and a combination of functions) such as inputs, format, substr, cat, compress, substitution&amp;nbsp;to convert this date character into a date9. format - without success.&lt;BR /&gt;&lt;BR /&gt;I am sure there is an easy way to resolve this. Please advise.&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 13:51:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/50-chardate-to-date-format/m-p/691257#M37286</guid>
      <dc:creator>Ross12345</dc:creator>
      <dc:date>2020-10-13T13:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: $50. chardate to date format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/50-chardate-to-date-format/m-p/691259#M37287</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 Date_char = '22-SEP-20';
run;

data want;
 set have;
 sas_date=input(date_char,date9.);/*read and convert to num date*/
 format sas_date date9.;/*format the sas date for appropriate display*/
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Oct 2020 13:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/50-chardate-to-date-format/m-p/691259#M37287</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-10-13T13:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: $50. chardate to date format</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/50-chardate-to-date-format/m-p/691271#M37288</link>
      <description>&lt;P&gt;So your variable can hold up to 50 bytes.&amp;nbsp; The example value you showed is only 9 bytes long.&amp;nbsp; If the rest of the values follow that pattern then the DATE informat should work.&amp;nbsp; Just make sure to remove any leading spaces in the values before trying to read it with the DATE informat.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  date_num = input(left(date_char),date11.);
  format date_num date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Oct 2020 14:13:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/50-chardate-to-date-format/m-p/691271#M37288</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-10-13T14:13:06Z</dc:date>
    </item>
  </channel>
</rss>

