<?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: Changing string date to date variable in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-string-date-to-date-variable/m-p/511630#M32465</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/116786"&gt;@Sean_OConnor&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's a bit odd that&amp;nbsp;there is a SAS format to write such values (see link provided by RW9), but no informat counterpart. The YYMMN. informat comes close, but requires us to remove the "M":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
m='2010M01';
d=input(compress(m,'M'),yymmn6.);
format d date9.;
run;

proc print data=test;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that the resulting date value defaults to the &lt;EM&gt;first&lt;/EM&gt;&amp;nbsp;day of the month.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Nov 2018 11:11:44 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2018-11-09T11:11:44Z</dc:date>
    <item>
      <title>Changing string date to date variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-string-date-to-date-variable/m-p/511625#M32462</link>
      <description>&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a String variable in the following format - 2010M01.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to convert it to a sas date variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sean&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 10:52:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-string-date-to-date-variable/m-p/511625#M32462</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2018-11-09T10:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Changing string date to date variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-string-date-to-date-variable/m-p/511626#M32463</link>
      <description>&lt;P&gt;Use:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000199309.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000199309.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 11:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-string-date-to-date-variable/m-p/511626#M32463</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-09T11:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Changing string date to date variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-string-date-to-date-variable/m-p/511629#M32464</link>
      <description>&lt;P&gt;Hi RV9,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still running into some trouble on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached a sample of code as an example;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;MONTH
2010M01
2010M02
2010M03
2014M01
2010M01
2016M01
2010M01
2018M12&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Nov 2018 11:11:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-string-date-to-date-variable/m-p/511629#M32464</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2018-11-09T11:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Changing string date to date variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-string-date-to-date-variable/m-p/511630#M32465</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/116786"&gt;@Sean_OConnor&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's a bit odd that&amp;nbsp;there is a SAS format to write such values (see link provided by RW9), but no informat counterpart. The YYMMN. informat comes close, but requires us to remove the "M":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
m='2010M01';
d=input(compress(m,'M'),yymmn6.);
format d date9.;
run;

proc print data=test;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that the resulting date value defaults to the &lt;EM&gt;first&lt;/EM&gt;&amp;nbsp;day of the month.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 11:11:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-string-date-to-date-variable/m-p/511630#M32465</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-11-09T11:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Changing string date to date variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-string-date-to-date-variable/m-p/511632#M32466</link>
      <description>&lt;P&gt;Remove the M, and use the yymmn informat:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
x1 = input(compress('2010M01','M'),yymmn6.);
format x1 yymmddd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Nov 2018 11:14:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Changing-string-date-to-date-variable/m-p/511632#M32466</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-09T11:14:19Z</dc:date>
    </item>
  </channel>
</rss>

