<?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: Character variable to Date variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Character-variable-to-Date-variable/m-p/206387#M51304</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you need the display to look like this I would keep this column as your display, you can use substr() to cut up the format and then go with the MONYY. format for any calculations that need done.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Apr 2015 14:27:23 GMT</pubDate>
    <dc:creator>Steelers_In_DC</dc:creator>
    <dc:date>2015-04-29T14:27:23Z</dc:date>
    <item>
      <title>Character variable to Date variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-variable-to-Date-variable/m-p/206385#M51302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a character variable (DateVar) which I want to convert to date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;DateVar='November 2014';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output dataset should also show the value of DateVar as &lt;EM&gt;November 2014&lt;/EM&gt; but as a date variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 13:43:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-variable-to-Date-variable/m-p/206385#M51302</guid>
      <dc:creator>VD</dc:creator>
      <dc:date>2015-04-29T13:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Character variable to Date variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-variable-to-Date-variable/m-p/206386#M51303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd split the string with SCAN and then use the FINDW function to determine the month out of a reference string.&lt;/P&gt;&lt;P&gt;I doubt that a single format could be made that handles the display in one step. You may have to create a separate character variable for display (or keep the original column).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 14:06:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-variable-to-Date-variable/m-p/206386#M51303</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-04-29T14:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Character variable to Date variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-variable-to-Date-variable/m-p/206387#M51304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you need the display to look like this I would keep this column as your display, you can use substr() to cut up the format and then go with the MONYY. format for any calculations that need done.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 14:27:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-variable-to-Date-variable/m-p/206387#M51304</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-04-29T14:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Character variable to Date variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-variable-to-Date-variable/m-p/206388#M51305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;DateVar='November 2014';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data prep;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;month = substr(datevar,1,3);&lt;/P&gt;&lt;P&gt;year = scan(datevar,2,' ');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;format new_date monyy7.;&lt;/P&gt;&lt;P&gt;set prep;&lt;/P&gt;&lt;P&gt;new_date = input(put(trim(month)||trim(year),$char7.),monyy7.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 14:34:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-variable-to-Date-variable/m-p/206388#M51305</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-04-29T14:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: Character variable to Date variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-variable-to-Date-variable/m-p/206389#M51306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2015 12:54:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-variable-to-Date-variable/m-p/206389#M51306</guid>
      <dc:creator>VD</dc:creator>
      <dc:date>2015-04-30T12:54:12Z</dc:date>
    </item>
  </channel>
</rss>

