<?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 a date in a character field to an actual date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/converting-a-date-in-a-character-field-to-an-actual-date/m-p/499672#M132990</link>
    <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 27 Sep 2018 19:18:45 GMT</pubDate>
    <dc:creator>Elliott</dc:creator>
    <dc:date>2018-09-27T19:18:45Z</dc:date>
    <item>
      <title>converting a date in a character field to an actual date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-a-date-in-a-character-field-to-an-actual-date/m-p/499237#M132803</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a date in a character field that looks like 2017JAN and I need to convert to 201701 in another field, so it is recognized as a date.&amp;nbsp; I have tried everything I can think of and researched but can not get the conversion to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any assistance will be greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Elliott&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 19:50:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-a-date-in-a-character-field-to-an-actual-date/m-p/499237#M132803</guid>
      <dc:creator>Elliott</dc:creator>
      <dc:date>2018-09-26T19:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: converting a date in a character field to an actual date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-a-date-in-a-character-field-to-an-actual-date/m-p/499241#M132806</link>
      <description>&lt;P&gt;In SAS, 201701 is not a date.&amp;nbsp; The conversion can be made as you requested, but you are not getting a date as the result.&amp;nbsp; Here is one way to go about it.&amp;nbsp; It gets your six-digits as a numeric value:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;newvar = input(oldvar, 4.) * 100 + month(input('01' || substr(oldvar, 5, 3) || substr(oldvar, 1, 4), date9.);&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 19:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-a-date-in-a-character-field-to-an-actual-date/m-p/499241#M132806</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-09-26T19:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: converting a date in a character field to an actual date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-a-date-in-a-character-field-to-an-actual-date/m-p/499520#M132942</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
x='2017JAN';
y=input(cats(substr(x,5),substr(x,1,4)),monyy7.);
format y yymmn6.;
run;
proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Sep 2018 13:55:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-a-date-in-a-character-field-to-an-actual-date/m-p/499520#M132942</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-09-27T13:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: converting a date in a character field to an actual date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-a-date-in-a-character-field-to-an-actual-date/m-p/499672#M132990</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 19:18:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-a-date-in-a-character-field-to-an-actual-date/m-p/499672#M132990</guid>
      <dc:creator>Elliott</dc:creator>
      <dc:date>2018-09-27T19:18:45Z</dc:date>
    </item>
  </channel>
</rss>

