<?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: Cannot input YYYYmmm char variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Cannot-input-YYYYmmm-char-variable/m-p/334044#M75379</link>
    <description>&lt;P&gt;If you really can't change your source data to monyy before your final step&amp;nbsp;gets hold of it, you can do it this way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data old;
do date = '2008dec', '2009jan', '2009dec';
   output;
   end;
stop;
run;

data new; &lt;BR /&gt;set old;
Date_num = input(substr(date, 5, 3) || substr(date, 1, 4), monyy7.);
format Date_num DATE9.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 18 Feb 2017 09:28:34 GMT</pubDate>
    <dc:creator>LaurieF</dc:creator>
    <dc:date>2017-02-18T09:28:34Z</dc:date>
    <item>
      <title>Cannot input YYYYmmm char variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cannot-input-YYYYmmm-char-variable/m-p/334041#M75378</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a char variable containing dates such as : 2008Dec ;&amp;nbsp;2009Jan ...&lt;/P&gt;&lt;P&gt;I want to convert it to numeric datetime and then format it as DATE9.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However it seems that yymon7. works only as format. What should I use then?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data new; set old;
	Date_num = input(Date, yymon7.);&lt;BR /&gt;	format Date_num DATE9.;&lt;BR /&gt;run;&lt;/PRE&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>Sat, 18 Feb 2017 08:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cannot-input-YYYYmmm-char-variable/m-p/334041#M75378</guid>
      <dc:creator>KonstantinV</dc:creator>
      <dc:date>2017-02-18T08:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot input YYYYmmm char variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cannot-input-YYYYmmm-char-variable/m-p/334044#M75379</link>
      <description>&lt;P&gt;If you really can't change your source data to monyy before your final step&amp;nbsp;gets hold of it, you can do it this way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data old;
do date = '2008dec', '2009jan', '2009dec';
   output;
   end;
stop;
run;

data new; &lt;BR /&gt;set old;
Date_num = input(substr(date, 5, 3) || substr(date, 1, 4), monyy7.);
format Date_num DATE9.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Feb 2017 09:28:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cannot-input-YYYYmmm-char-variable/m-p/334044#M75379</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2017-02-18T09:28:34Z</dc:date>
    </item>
  </channel>
</rss>

