<?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 Univariate- commas to decimals in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Univariate-commas-to-decimals/m-p/489579#M72073</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have a dataset with a variable that contains some numbers as "x.y" and others as "x,y".. and I would like to do a univariate analysis on that variable, but sas categorizes the ones with a comma in between as missing. I tried to convert the commas with Commax and comma and numx and nothing seems to Work! Also tried locale but that doesnt make a difference. Please help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; What can be done?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Janet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;My variable's name is s_result (it's a character and I converted it to numeric). The code is as such:&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; dist2; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; dist (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;rename&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=(s_result=s_result_char));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;s_result=input(s_result_char, &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;best.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;univariate&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;VAR&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; s_result;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Aug 2018 13:37:48 GMT</pubDate>
    <dc:creator>JanetJanbek</dc:creator>
    <dc:date>2018-08-24T13:37:48Z</dc:date>
    <item>
      <title>Univariate- commas to decimals</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Univariate-commas-to-decimals/m-p/489579#M72073</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have a dataset with a variable that contains some numbers as "x.y" and others as "x,y".. and I would like to do a univariate analysis on that variable, but sas categorizes the ones with a comma in between as missing. I tried to convert the commas with Commax and comma and numx and nothing seems to Work! Also tried locale but that doesnt make a difference. Please help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; What can be done?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Janet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;My variable's name is s_result (it's a character and I converted it to numeric). The code is as such:&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; dist2; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; dist (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;rename&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=(s_result=s_result_char));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;s_result=input(s_result_char, &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;best.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;univariate&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;VAR&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; s_result;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 13:37:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Univariate-commas-to-decimals/m-p/489579#M72073</guid>
      <dc:creator>JanetJanbek</dc:creator>
      <dc:date>2018-08-24T13:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Univariate- commas to decimals</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Univariate-commas-to-decimals/m-p/489583#M72074</link>
      <description>&lt;P&gt;Use a conditional input:&lt;/P&gt;
&lt;PRE&gt;data dist2; 
  set dist (rename=(s_result=s_result_char));
  if index(s_result_char,",") then s_result=input(s_result_char,comma.);
  else s_result=input(s_result_char,best.);
run;

proc univariate; 
  var s_result;
run;&lt;/PRE&gt;
&lt;P&gt;Note not tested as no test data in the form of a datastep.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 13:49:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Univariate-commas-to-decimals/m-p/489583#M72074</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-24T13:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Univariate- commas to decimals</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Univariate-commas-to-decimals/m-p/489601#M72076</link>
      <description>&lt;P&gt;Thank you SO much. Worked!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 14:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Univariate-commas-to-decimals/m-p/489601#M72076</guid>
      <dc:creator>JanetJanbek</dc:creator>
      <dc:date>2018-08-24T14:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Univariate- commas to decimals</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Univariate-commas-to-decimals/m-p/489634#M72077</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/228173"&gt;@JanetJanbek&lt;/a&gt;: Please wait. It's possible that your code ran without error messages, but used incorrect values! The COMMA. informat would not treat commas as decimal points. Better use NUMX. and compare the results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: Moreover, the COMMA and COMMAX informats have a default length of 1 (not 12 as NUMX.). So, without a length specification (e.g. COMMAX12.) they would read only the &lt;EM&gt;first&lt;/EM&gt; character of the input string.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 16:30:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Univariate-commas-to-decimals/m-p/489634#M72077</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-08-24T16:30:18Z</dc:date>
    </item>
  </channel>
</rss>

