<?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: Convert dd-mmm-yy character variable to a date variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-dd-mmm-yy-character-variable-to-a-date-variable/m-p/319596#M70247</link>
    <description>&lt;P&gt;Thank you for this example!&lt;/P&gt;</description>
    <pubDate>Fri, 16 Dec 2016 17:10:27 GMT</pubDate>
    <dc:creator>RandiRyterman</dc:creator>
    <dc:date>2016-12-16T17:10:27Z</dc:date>
    <item>
      <title>Convert dd-mmm-yy character variable to a date variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dd-mmm-yy-character-variable-to-a-date-variable/m-p/319570#M70229</link>
      <description>&lt;P&gt;I am a new SAS user. &amp;nbsp;I imported a date in the format dd-mmm-yy that was unfortunately read as a character variable ($9). &amp;nbsp;I need to convert it to a date so that I can perform logical operations on it. &amp;nbsp;How do I convert this variable to a date variable?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 15:55:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dd-mmm-yy-character-variable-to-a-date-variable/m-p/319570#M70229</guid>
      <dc:creator>RandiRyterman</dc:creator>
      <dc:date>2016-12-16T15:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dd-mmm-yy character variable to a date variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dd-mmm-yy-character-variable-to-a-date-variable/m-p/319579#M70236</link>
      <description>&lt;PRE&gt;data example;
   x='11-FEB-16';
   date = input(compress(x,'-'),date7.);
   put date mmddyy10.;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Dec 2016 16:16:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dd-mmm-yy-character-variable-to-a-date-variable/m-p/319579#M70236</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-12-16T16:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dd-mmm-yy character variable to a date variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dd-mmm-yy-character-variable-to-a-date-variable/m-p/319581#M70237</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here's an example I use with my students. CHARDAY is a character string and BIRTHDAY is created as the number of days from Jan 1, 1960 by using the INPUT function.&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data bday;
  length charday $9;
  infile datalines;
  input name $ charday $;
return;
datalines;
alan 01jan1960
barb 15nov1950
carl 29nov1984
dana 29sep2014
;
run;
  
data howold;
  set bday;
  birthday = input(charday,date9.);
  howold_days = (today()-birthday);
  howold_years = (today()-birthday)/365.25;
run;
  
title "After converting CHARDAY to numeric BIRTHDAY";
proc print data=howold;
  var name charday birthday howold_days howold_years;
  format birthday mmddyy10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Dec 2016 16:20:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dd-mmm-yy-character-variable-to-a-date-variable/m-p/319581#M70237</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-12-16T16:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dd-mmm-yy character variable to a date variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dd-mmm-yy-character-variable-to-a-date-variable/m-p/319595#M70246</link>
      <description>&lt;P&gt;Thanks so much!!!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 17:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dd-mmm-yy-character-variable-to-a-date-variable/m-p/319595#M70246</guid>
      <dc:creator>RandiRyterman</dc:creator>
      <dc:date>2016-12-16T17:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Convert dd-mmm-yy character variable to a date variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-dd-mmm-yy-character-variable-to-a-date-variable/m-p/319596#M70247</link>
      <description>&lt;P&gt;Thank you for this example!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 17:10:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-dd-mmm-yy-character-variable-to-a-date-variable/m-p/319596#M70247</guid>
      <dc:creator>RandiRyterman</dc:creator>
      <dc:date>2016-12-16T17:10:27Z</dc:date>
    </item>
  </channel>
</rss>

