<?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 Character Date to Numeric in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Convert-Character-Date-to-Numeric/m-p/634469#M19029</link>
    <description>&lt;P&gt;And if your data is a bit sloppy about consistent lengths you may want a different informat with more flexibility.&lt;/P&gt;
&lt;PRE&gt;data want;
	character_date = '02 aug 2017';
	date=input(character_date,anydtdte.);
	format date date9.;
run;&lt;/PRE&gt;
&lt;P&gt;The Anydtdte format by default allows more characters and will read some fairly messy dates but caution is needed if you have two-digit years at the start of your date.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Mar 2020 16:05:22 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-03-24T16:05:22Z</dc:date>
    <item>
      <title>Convert Character Date to Numeric</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Convert-Character-Date-to-Numeric/m-p/634447#M19024</link>
      <description>&lt;P&gt;Hi everyone, I am trying to convert a date variable that is stored as a character variable into a numeric variable. However, the date variable is in the format "02 AUG 2017". I want the result outputted as a new date variable that is numeric.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  date=input(character_date,date10.);
  format date date10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Nothing that I have tried has worked. I would appreciate any assistance. Thank you in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 14:56:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Convert-Character-Date-to-Numeric/m-p/634447#M19024</guid>
      <dc:creator>AshJuri</dc:creator>
      <dc:date>2020-03-24T14:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Character Date to Numeric</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Convert-Character-Date-to-Numeric/m-p/634449#M19025</link>
      <description>&lt;P&gt;Count the number of characters in your string, including the blanks, and you will see that you need to read 11 characters.&lt;/P&gt;
&lt;P&gt;Therefore this works:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
character_date = '02 aug 2017';
date=input(character_date,date11.);
format date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Mar 2020 15:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Convert-Character-Date-to-Numeric/m-p/634449#M19025</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-24T15:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Character Date to Numeric</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Convert-Character-Date-to-Numeric/m-p/634469#M19029</link>
      <description>&lt;P&gt;And if your data is a bit sloppy about consistent lengths you may want a different informat with more flexibility.&lt;/P&gt;
&lt;PRE&gt;data want;
	character_date = '02 aug 2017';
	date=input(character_date,anydtdte.);
	format date date9.;
run;&lt;/PRE&gt;
&lt;P&gt;The Anydtdte format by default allows more characters and will read some fairly messy dates but caution is needed if you have two-digit years at the start of your date.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 16:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Convert-Character-Date-to-Numeric/m-p/634469#M19029</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-24T16:05:22Z</dc:date>
    </item>
  </channel>
</rss>

