<?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: Converting Character Date to DATE yymmn6. failed in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Converting-Character-Date-to-DATE-yymmn6-failed/m-p/519067#M140531</link>
    <description>&lt;P&gt;I have also tried putting format newperiod yymmn6. but the field is entirely blank.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Dec 2018 10:04:08 GMT</pubDate>
    <dc:creator>imdickson</dc:creator>
    <dc:date>2018-12-06T10:04:08Z</dc:date>
    <item>
      <title>Converting Character Date to DATE yymmn6. failed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Character-Date-to-DATE-yymmn6-failed/m-p/519065#M140529</link>
      <description>&lt;P&gt;Hi everyone. I am trying to onvert character date(MONYY) to DATE type yymmn6.&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.trans_load_re_oldfull;
set work.trans_load_re_oldfull;
    length newperiod $8.;
    charyear='JAN2018';
	newperiod=input(_NAME_,best.);

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nothing came out. Anyone knows why?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 09:54:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Character-Date-to-DATE-yymmn6-failed/m-p/519065#M140529</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2018-12-06T09:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Character Date to DATE yymmn6. failed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Character-Date-to-DATE-yymmn6-failed/m-p/519067#M140531</link>
      <description>&lt;P&gt;I have also tried putting format newperiod yymmn6. but the field is entirely blank.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 10:04:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Character-Date-to-DATE-yymmn6-failed/m-p/519067#M140531</guid>
      <dc:creator>imdickson</dc:creator>
      <dc:date>2018-12-06T10:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Character Date to DATE yymmn6. failed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Character-Date-to-DATE-yymmn6-failed/m-p/519069#M140533</link>
      <description>&lt;P&gt;Do like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
   charyear='JAN2018';
   newperiod=input(charyear,monyy7.);
   format newperiod &lt;SPAN&gt;yymmn6.&lt;/SPAN&gt;;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Dec 2018 10:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Character-Date-to-DATE-yymmn6-failed/m-p/519069#M140533</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-12-06T10:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Character Date to DATE yymmn6. failed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Character-Date-to-DATE-yymmn6-failed/m-p/519075#M140539</link>
      <description>&lt;P&gt;First of all: do not overwrite a dataset in the same data step while you're still developing; any mistake will force you to recreate the dataset from its origins.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.trans_load_re_oldfull;
set work.trans_load_re_oldfull;
    length newperiod $8.;
    charyear='JAN2018';
	newperiod=input(_NAME_,best.);

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You are setting charyear, but don't use it.&lt;/P&gt;
&lt;P&gt;You define newperiod as character, and then assign a numeric value to it, forcing an automatic type conversion. Bad.&lt;/P&gt;
&lt;P&gt;Is _NAME_ present on your dataset? If yes, is it of type character? If yes, what does it contain?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 10:17:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Character-Date-to-DATE-yymmn6-failed/m-p/519075#M140539</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-06T10:17:50Z</dc:date>
    </item>
  </channel>
</rss>

