<?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 Change a character variable to a numeric variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-a-character-variable-to-a-numeric-variable/m-p/779963#M248463</link>
    <description>&lt;P&gt;I want to change a character variable to a numeric variable.&amp;nbsp; The column name is VALUE (length=8, type=char, format=$8., informat=$8.) and the character values in the VALUE column look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VALUE&lt;/P&gt;&lt;P&gt;-2,88&lt;/P&gt;&lt;P&gt;2,68&lt;/P&gt;&lt;P&gt;-6,22&lt;/P&gt;&lt;P&gt;-4,57&lt;/P&gt;&lt;P&gt;5,42&lt;/P&gt;&lt;P&gt;and so on&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that I should use the input function and I want to change the commas to decimals points.&amp;nbsp; Data is coming from Europe so it's using the comma instead of a decimal point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;num_value=input(value,????);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Nov 2021 13:39:00 GMT</pubDate>
    <dc:creator>PaulN</dc:creator>
    <dc:date>2021-11-12T13:39:00Z</dc:date>
    <item>
      <title>Change a character variable to a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-a-character-variable-to-a-numeric-variable/m-p/779963#M248463</link>
      <description>&lt;P&gt;I want to change a character variable to a numeric variable.&amp;nbsp; The column name is VALUE (length=8, type=char, format=$8., informat=$8.) and the character values in the VALUE column look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VALUE&lt;/P&gt;&lt;P&gt;-2,88&lt;/P&gt;&lt;P&gt;2,68&lt;/P&gt;&lt;P&gt;-6,22&lt;/P&gt;&lt;P&gt;-4,57&lt;/P&gt;&lt;P&gt;5,42&lt;/P&gt;&lt;P&gt;and so on&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that I should use the input function and I want to change the commas to decimals points.&amp;nbsp; Data is coming from Europe so it's using the comma instead of a decimal point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;num_value=input(value,????);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 13:39:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-a-character-variable-to-a-numeric-variable/m-p/779963#M248463</guid>
      <dc:creator>PaulN</dc:creator>
      <dc:date>2021-11-12T13:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Change a character variable to a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-a-character-variable-to-a-numeric-variable/m-p/779965#M248464</link>
      <description>&lt;P&gt;Something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input VALUE $;
datalines;
-2,88 
2,68  
-6,22 
-4,57 
5,42  
;

data want;
   set have;
   numval = input(value, commax8.2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Nov 2021 13:41:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-a-character-variable-to-a-numeric-variable/m-p/779965#M248464</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-11-12T13:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Change a character variable to a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-a-character-variable-to-a-numeric-variable/m-p/779973#M248468</link>
      <description>&lt;P&gt;Depending on what your data might contain, a slight change could be in order.&amp;nbsp; Compare these results:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input VALUE $;
datalines;
-28 
2,68  
-6,22 
-4,57 
5  
;

data want;
   set have;
   numval1 = input(value, commax8.2);
   numval2 = input(value, commax8.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Nov 2021 14:07:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-a-character-variable-to-a-numeric-variable/m-p/779973#M248468</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-11-12T14:07:21Z</dc:date>
    </item>
  </channel>
</rss>

