<?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: Sum function statement generating exponential values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-statement-generating-exponential-values/m-p/367857#M275413</link>
    <description>&lt;P&gt;What&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;&amp;nbsp;said, but you're getting really small numbers - ie 2.4X10^-13 or something like that? This has to do with numerical precision and how SAS can store numbers. It's a common issue in programming across all languages and more of a binary computer issue. Until we get quantam &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jun 2017 19:00:21 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-06-16T19:00:21Z</dc:date>
    <item>
      <title>Sum function statement generating exponential values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-statement-generating-exponential-values/m-p/367854#M275411</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table snp as&lt;BR /&gt;select sum(Amount) as amt&lt;BR /&gt;from tbl&lt;BR /&gt;group by prdct&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i am summing the amount when the sum value is zero it's generating exponential value. what's causing the problem&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have amounts like below&lt;/P&gt;&lt;P&gt;Amount&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;208990.99&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;547244.6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;91914.11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;-208990.99&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;-91914.11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;-547244.6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used round function to overcome the problem but curious what caused the problem and using the round function appropriate solution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what i used&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc sql;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;create table snp as &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;select round(sum(Amount),0.01) &amp;nbsp;as amt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from tbl&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;group by prdct&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 18:41:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-function-statement-generating-exponential-values/m-p/367854#M275411</guid>
      <dc:creator>JasonNC</dc:creator>
      <dc:date>2017-06-16T18:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sum function statement generating exponential values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-statement-generating-exponential-values/m-p/367856#M275412</link>
      <description>&lt;P&gt;My guess is that you're not getting Exponential values but, rather, large numbers being shown using scientific notation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, rather than outputing the sums, output sum(amount)/1000000 and that way you wil get the sum of number of millions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 18:52:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-function-statement-generating-exponential-values/m-p/367856#M275412</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-06-16T18:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sum function statement generating exponential values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-statement-generating-exponential-values/m-p/367857#M275413</link>
      <description>&lt;P&gt;What&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;&amp;nbsp;said, but you're getting really small numbers - ie 2.4X10^-13 or something like that? This has to do with numerical precision and how SAS can store numbers. It's a common issue in programming across all languages and more of a binary computer issue. Until we get quantam &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 19:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-function-statement-generating-exponential-values/m-p/367857#M275413</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-16T19:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sum function statement generating exponential values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-function-statement-generating-exponential-values/m-p/367866#M275414</link>
      <description>&lt;P&gt;And it may just be that the format is too small to display well.&lt;/P&gt;
&lt;PRE&gt;data _null_;
   x=12345678;
   put x= best4.;
run;&lt;/PRE&gt;
&lt;P&gt;Displays x as 12E6 because I told it display with only 4 columns. So the closest value SAS can display with 4 columns is the exponential.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 19:43:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-function-statement-generating-exponential-values/m-p/367866#M275414</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-16T19:43:14Z</dc:date>
    </item>
  </channel>
</rss>

