<?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 from character to numeric VERSION - character values won't become numeric in new vari in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370096#M275650</link>
    <description>&lt;P&gt;Redcap can generate a CSV file instead - if the file is in the same format everytime and you're doing this often I'd strongly suggest fixing the import step instead of manually recoding things.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jun 2017 19:10:56 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-06-23T19:10:56Z</dc:date>
    <item>
      <title>Converting from character to numeric VERSION - character values won't become numeric in new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370070#M275644</link>
      <description>&lt;P&gt;I can't covert all of my data into numeric in SAS version 9. I cleaned all my data and made the character values numerical manually and now I'm trying to get the proc contents to read it as numerical so I can perform statistical tests. This is the code I have been using&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9780i7D2DE380EA0FB641/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="logcode.PNG" title="logcode.PNG" /&gt;&lt;/P&gt;&lt;P&gt;I used proc print to check that my data was correct. NEWLOG2 refers to the new variable that is numeric and LOG2 is the original edited variable that now has all numerical values. 1.59 was original included text but won't covert over numerically in the new variable. PLEASE HELP!!!!&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9781i00AA75D32E2DCD2C/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="newlog.PNG" title="newlog.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 19:02:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370070#M275644</guid>
      <dc:creator>jmcbroo</dc:creator>
      <dc:date>2017-06-23T19:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from character to numeric VERSION - character values won't become numeric in new vari</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370081#M275645</link>
      <description>&lt;PRE&gt;newlog1 = log1 + 0;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Jun 2017 18:19:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370081#M275645</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-06-23T18:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from character to numeric VERSION - character values won't become numeric in new vari</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370091#M275646</link>
      <description>&lt;P&gt;Your code and words refer to NEWLOG1 but your image shows NEWLOG2 and LOG2?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 18:57:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370091#M275646</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-23T18:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from character to numeric VERSION - character values won't become numeric in new vari</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370093#M275647</link>
      <description>Sorry I changed it. Will be doing this for all my character variables.</description>
      <pubDate>Fri, 23 Jun 2017 19:03:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370093#M275647</guid>
      <dc:creator>jmcbroo</dc:creator>
      <dc:date>2017-06-23T19:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from character to numeric VERSION - character values won't become numeric in new vari</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370094#M275648</link>
      <description>&lt;P&gt;Where does your data originate from? A text, XLSX, SAS file?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 19:04:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370094#M275648</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-23T19:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from character to numeric VERSION - character values won't become numeric in new vari</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370095#M275649</link>
      <description>&lt;P&gt;REDCAP - then exported into excel - then exported into SAS. Excel is the main source.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 19:08:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370095#M275649</guid>
      <dc:creator>jmcbroo</dc:creator>
      <dc:date>2017-06-23T19:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from character to numeric VERSION - character values won't become numeric in new vari</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370096#M275650</link>
      <description>&lt;P&gt;Redcap can generate a CSV file instead - if the file is in the same format everytime and you're doing this often I'd strongly suggest fixing the import step instead of manually recoding things.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 19:10:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370096#M275650</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-23T19:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Converting from character to numeric VERSION - character values won't become numeric in new vari</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370174#M275651</link>
      <description>&lt;P&gt;Did you get errors from the INPUT() function for the lines that generated missing values?&lt;/P&gt;
&lt;P&gt;Either your values are right aligned so that the first 5 characters do not have any value or they have some "invisible" characters that are causing the text to not look like numbers.&lt;/P&gt;
&lt;P&gt;First, &amp;nbsp;use &amp;nbsp;32. &amp;nbsp;or even better COMMA32. as your INFORMAT. &amp;nbsp;(Note BEST is a FORMAT and not an INFORMAT).&lt;/P&gt;
&lt;P&gt;Second remove the spaces and/or non digits from the string.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  infile cards truncover ;
  input str $char50. ;
  if _n_=1 then str='A0'x||str;
  if _n_=2 then str=strip(str)||'0D'x;
  num1 = input(str,??5.);
  num2 = input(compress(str,'($,ED.)','kd'),??comma32.);
  put num1= best9. @15 num2=best9. @30 str=:$quote.;
cards;
3456
4567
456.123
          5677
1.234E3
(123,345)
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;num1=.        num2=3456      str="&amp;nbsp;3456"
num1=.        num2=4567      str="4567
"
num1=456.1    num2=456.123   str="456.123"
num1=.        num2=5677      str="          5677"
num1=1.234    num2=1234      str="1.234E3"
num1=.        num2=-123345   str="(123,345)"&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 21:32:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-from-character-to-numeric-VERSION-character-values/m-p/370174#M275651</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-23T21:32:49Z</dc:date>
    </item>
  </channel>
</rss>

