<?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 the character to numeric in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/convert-the-character-to-numeric/m-p/276542#M55414</link>
    <description>&lt;P&gt;It shouldn't be. Double check your code and output. Was your log clean? Is S already in your dataset, you can't change a variable type if it already exists in the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
m='12345678';
run;
data b;
set a;
s=input(m, 8.);
run;

proc contents data=b;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Alphabetic List of Variables and Attributes&lt;/P&gt;
&lt;P&gt;#Variable Type Len&lt;/P&gt;
&lt;P&gt;1m Char 8&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;2&amp;nbsp;s Num 8&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jun 2016 16:29:53 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-06-10T16:29:53Z</dc:date>
    <item>
      <title>convert the character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-the-character-to-numeric/m-p/276523#M55407</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;Hello,&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;why I can't convert the character m to numeric s?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; a;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;m=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'12345678'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; b;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; a;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;s=put(m, &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$8.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;); &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;Thanks&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 15:20:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-the-character-to-numeric/m-p/276523#M55407</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2016-06-10T15:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: convert the character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-the-character-to-numeric/m-p/276527#M55408</link>
      <description>&lt;P&gt;PUT always creates a character variable used the way you did&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; b;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; a;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;s= input(m, &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;8.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;); &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 15:30:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-the-character-to-numeric/m-p/276527#M55408</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-06-10T15:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: convert the character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-the-character-to-numeric/m-p/276535#M55411</link>
      <description>&lt;P&gt;thank you, but s is still&amp;nbsp;a char.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 16:10:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-the-character-to-numeric/m-p/276535#M55411</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2016-06-10T16:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: convert the character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-the-character-to-numeric/m-p/276542#M55414</link>
      <description>&lt;P&gt;It shouldn't be. Double check your code and output. Was your log clean? Is S already in your dataset, you can't change a variable type if it already exists in the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
m='12345678';
run;
data b;
set a;
s=input(m, 8.);
run;

proc contents data=b;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Alphabetic List of Variables and Attributes&lt;/P&gt;
&lt;P&gt;#Variable Type Len&lt;/P&gt;
&lt;P&gt;1m Char 8&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;2&amp;nbsp;s Num 8&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 16:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-the-character-to-numeric/m-p/276542#M55414</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-10T16:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: convert the character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-the-character-to-numeric/m-p/277366#M55676</link>
      <description>&lt;P&gt;I found the problem, the import excel file including special characters which make SAS function can't recginize that variable.&lt;/P&gt;
&lt;P&gt;the special characters are something like ctrl+ enter in excel.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 20:10:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-the-character-to-numeric/m-p/277366#M55676</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2016-06-14T20:10:11Z</dc:date>
    </item>
  </channel>
</rss>

