<?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 to numeric in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-numeric/m-p/266298#M57950</link>
    <description>&lt;P&gt;Please give &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt; credit by marking his answer as the solution.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Apr 2016 07:16:26 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-04-26T07:16:26Z</dc:date>
    <item>
      <title>Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-numeric/m-p/266105#M57939</link>
      <description>&lt;P&gt;I know this is going to sound so ridiculous, but bear with me, I'm fairly new to SAS and please in answer I am looking for example code. I have a dataset that I am preparing to do a linkage on. The date format is wrong for a variable it is a character defined variable with the numeric string formatted MMDDYYYY. I need to convert it to numeric so that this code below will work for converting the date. How do I convert the variable to numeric so I can use the code below?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data &lt;EM&gt;set&lt;/EM&gt;;&lt;BR /&gt;set &lt;EM&gt;set&lt;/EM&gt;;&lt;BR /&gt;DOB=put(DOB,yymmdd8.);&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 16:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-to-numeric/m-p/266105#M57939</guid>
      <dc:creator>chadwae</dc:creator>
      <dc:date>2016-04-25T16:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-numeric/m-p/266115#M57940</link>
      <description>&lt;P&gt;Your code is for creating a character variable from a date value. &amp;nbsp;So if your original variable is also character then you just add an INPUT() function call to convert it to a date so the PUT() function will work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WANT;
  set HAVE;
  DOB=put(input(DOB,mmddyy8.),yymmddN8.);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also if you want the result ot look like YYYYMMDD (with no delimiters) then use the yymmddN format.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 17:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-to-numeric/m-p/266115#M57940</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-04-25T17:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-numeric/m-p/266117#M57941</link>
      <description>&lt;P&gt;Thank you! I almost had it right, but was missing just a small part. This is perfect!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 17:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-to-numeric/m-p/266117#M57941</guid>
      <dc:creator>chadwae</dc:creator>
      <dc:date>2016-04-25T17:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-numeric/m-p/266298#M57950</link>
      <description>&lt;P&gt;Please give &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt; credit by marking his answer as the solution.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2016 07:16:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-to-numeric/m-p/266298#M57950</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-04-26T07:16:26Z</dc:date>
    </item>
  </channel>
</rss>

