<?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 convert non-standard character variable to date? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-non-standard-character-variable-to-date/m-p/493867#M130032</link>
    <description>cool, thanks!</description>
    <pubDate>Sun, 09 Sep 2018 03:59:08 GMT</pubDate>
    <dc:creator>xyxu</dc:creator>
    <dc:date>2018-09-09T03:59:08Z</dc:date>
    <item>
      <title>How to convert non-standard character variable to date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-non-standard-character-variable-to-date/m-p/493864#M130029</link>
      <description>&lt;P&gt;I have a character variable with length $7. I want to convert it into a date variable with yyyymm format. However, the values of the character variable is a bit messy. For examples, there are both "2018-09" and "2018-9". I tried to use&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
format date_new yymmn6.;
set have;
date_new = input(date_char, yymmn6.);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but all of the new date variable values are missing.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Sep 2018 03:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-non-standard-character-variable-to-date/m-p/493864#M130029</guid>
      <dc:creator>xyxu</dc:creator>
      <dc:date>2018-09-09T03:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert non-standard character variable to date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-non-standard-character-variable-to-date/m-p/493865#M130030</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input date_char $;
date_new = input(cats(date_char,'-01'), anydtdte10.);
format date_new yymmn6.;
cards;
2018-09
2018-9
;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 09 Sep 2018 03:41:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-non-standard-character-variable-to-date/m-p/493865#M130030</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2018-09-09T03:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert non-standard character variable to date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-non-standard-character-variable-to-date/m-p/493866#M130031</link>
      <description>&lt;P&gt;Use the gorgeous compress with your original idea like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input   date  $;
cards;
2018-09
2018-9
;

data want;
set have;
new_date=input(compress(date,'-'),yymmn6.) ;
format new_date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 09 Sep 2018 03:52:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-non-standard-character-variable-to-date/m-p/493866#M130031</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-09-09T03:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert non-standard character variable to date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-non-standard-character-variable-to-date/m-p/493867#M130032</link>
      <description>cool, thanks!</description>
      <pubDate>Sun, 09 Sep 2018 03:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-non-standard-character-variable-to-date/m-p/493867#M130032</guid>
      <dc:creator>xyxu</dc:creator>
      <dc:date>2018-09-09T03:59:08Z</dc:date>
    </item>
  </channel>
</rss>

