<?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 Preserve Trailing zeros while converting from Character To Numeric in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Preserve-Trailing-zeros-while-converting-from-Character-To/m-p/480360#M124140</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need your help on below data to preserve trailing zeros while conversion from character to Numeric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please suggest if there is any possibility.I need final variable in best. numeric format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
 input test $ 1-8;
 datalines;
 10000
 10.305
 0.140
 0.1305
 ;
 
 data xx;
  set x;
  try=input(test,best.);
  run;
  proc print data=xx;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 23 Jul 2018 07:43:31 GMT</pubDate>
    <dc:creator>draroda</dc:creator>
    <dc:date>2018-07-23T07:43:31Z</dc:date>
    <item>
      <title>Preserve Trailing zeros while converting from Character To Numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Preserve-Trailing-zeros-while-converting-from-Character-To/m-p/480360#M124140</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need your help on below data to preserve trailing zeros while conversion from character to Numeric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please suggest if there is any possibility.I need final variable in best. numeric format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
 input test $ 1-8;
 datalines;
 10000
 10.305
 0.140
 0.1305
 ;
 
 data xx;
  set x;
  try=input(test,best.);
  run;
  proc print data=xx;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Jul 2018 07:43:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Preserve-Trailing-zeros-while-converting-from-Character-To/m-p/480360#M124140</guid>
      <dc:creator>draroda</dc:creator>
      <dc:date>2018-07-23T07:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Preserve Trailing zeros while converting from Character To Numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Preserve-Trailing-zeros-while-converting-from-Character-To/m-p/480363#M124142</link>
      <description>&lt;P&gt;The number of &lt;EM&gt;displayed&lt;/EM&gt;&amp;nbsp;trailing zeros will be determined by the format you use. eg 12.4 will always display 4 fractional digits, regardless of numeric content.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1.0000
2.1234
3.1200&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;etc&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 08:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Preserve-Trailing-zeros-while-converting-from-Character-To/m-p/480363#M124142</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-23T08:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Preserve Trailing zeros while converting from Character To Numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Preserve-Trailing-zeros-while-converting-from-Character-To/m-p/480365#M124144</link>
      <description>&lt;P&gt;Numbers do not have trailing, or leading zeroes by default.&amp;nbsp; 0.140 is exactly the same as 0.14, but fewer display characters.&amp;nbsp; Hence your use of best is correct.&amp;nbsp; If for some reason you need to keep the values exactly as given then you would either need to:&lt;/P&gt;
&lt;P&gt;a) fix number of decimals for every value&lt;/P&gt;
&lt;P&gt;b) stick with character, maybe have a secondary numeric version&lt;/P&gt;
&lt;P&gt;The second is always my preferred option, and in my industry pretty standard.&amp;nbsp; Keep the text for display - has however many extra bits and can be different for each item, and a numeric version for processing.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 08:43:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Preserve-Trailing-zeros-while-converting-from-Character-To/m-p/480365#M124144</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-07-23T08:43:12Z</dc:date>
    </item>
  </channel>
</rss>

