<?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: Automatic Rounding in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280105#M56552</link>
    <description>&lt;P&gt;Can you post the numbers you want to see?&lt;/P&gt;
&lt;P&gt;What version of SAS are you working on?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely it's related to numerical precision:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/68089/HTML/default/viewer.htm#p0ji1unv6thm0dn1gp4t01a1u0g6.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/68089/HTML/default/viewer.htm#p0ji1unv6thm0dn1gp4t01a1u0g6.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 25 Jun 2016 00:48:16 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-06-25T00:48:16Z</dc:date>
    <item>
      <title>Automatic Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280104#M56551</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the code below, the SAS base application in our office displays the values in 'displayed' column when a is divided by b, then multiplied to 100, even if we made the format best32. However, the calculator gives longer values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But when I tried doing the division in the "want" dataset in SAS Studio (SAS base on demand), the division works fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can the automatic rounding of SAS be fixed?&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;
&lt;P&gt;data have;&lt;BR /&gt;input a b displayed;&lt;BR /&gt;cards;&lt;BR /&gt;16854.17 197890.028 8.5169375&lt;BR /&gt;819368.85 369280 221.8828125&lt;BR /&gt;150914.35 255027.6243 59.1756875&lt;BR /&gt;226253.24 858790.6977 26.3455625&lt;BR /&gt;100876.91 363464.5669 27.7542625&lt;BR /&gt;14788.51 777104.3771 1.9030275&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;d = (a/b)*100;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2016 00:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280104#M56551</guid>
      <dc:creator>angeliquec</dc:creator>
      <dc:date>2016-06-25T00:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280105#M56552</link>
      <description>&lt;P&gt;Can you post the numbers you want to see?&lt;/P&gt;
&lt;P&gt;What version of SAS are you working on?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely it's related to numerical precision:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/68089/HTML/default/viewer.htm#p0ji1unv6thm0dn1gp4t01a1u0g6.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/68089/HTML/default/viewer.htm#p0ji1unv6thm0dn1gp4t01a1u0g6.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2016 00:48:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280105#M56552</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-25T00:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280107#M56554</link>
      <description>Hi Reeza, &lt;BR /&gt;&lt;BR /&gt;We're using 9.4. The numbers I want are those under column d in the want dataset, which have more precision</description>
      <pubDate>Sat, 25 Jun 2016 02:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280107#M56554</guid>
      <dc:creator>angeliquec</dc:creator>
      <dc:date>2016-06-25T02:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280109#M56555</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc print data=want;
format d 20.10;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 25 Jun 2016 02:56:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280109#M56555</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-06-25T02:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280301#M56619</link>
      <description>Hi Reeza&lt;BR /&gt;&lt;BR /&gt;Apologies, we are using SAS 9.0.&lt;BR /&gt;Is there a way to address this precision issue? &lt;BR /&gt;</description>
      <pubDate>Mon, 27 Jun 2016 01:07:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280301#M56619</guid>
      <dc:creator>angeliquec</dc:creator>
      <dc:date>2016-06-27T01:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280303#M56621</link>
      <description>&lt;P&gt;I doubt you're using 9.0...that would be akin to using Windows XP version 1, not even SP4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you get from:&lt;/P&gt;
&lt;P&gt;%put &amp;amp;sysver;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2016 01:34:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280303#M56621</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-27T01:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280317#M56625</link>
      <description>sorry, 9.4.&lt;BR /&gt;&lt;BR /&gt;For the first row in the have data, SAS gives a quotient of 8.516937500000 when the actual answer is 8.5163749995668. SAS seems to do truncation there.&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Jun 2016 04:38:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280317#M56625</guid>
      <dc:creator>angeliquec</dc:creator>
      <dc:date>2016-06-27T04:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Rounding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280369#M56647</link>
      <description>&lt;P&gt;Interesting, win7 calculator returns &lt;FONT face="courier new,courier"&gt;8.5169374982351308778429199070102&lt;/FONT&gt; for the first row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With format 20.10 applyed to variable d, SAS returns &lt;FONT face="courier new,courier"&gt;8.5169374982&lt;/FONT&gt; - SAS on Windows and Linux uses up to 15 digits. I don't think that value can be increased by altering a config file or by setting a sas system option.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2016 09:51:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-Rounding/m-p/280369#M56647</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2016-06-27T09:51:08Z</dc:date>
    </item>
  </channel>
</rss>

