<?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: proc sql rounding percentage no decimals in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-rounding-percentage-no-decimals/m-p/267966#M269360</link>
    <description>&lt;P&gt;Not quite sure exactly what you mean by "calculation reads 100,0"&lt;/P&gt;
&lt;P&gt;Round is applied AFTER the results of&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;(SUM(numberA)*&lt;/FONT&gt;&lt;FONT color="#008080" face="SAS Monospace" size="2"&gt;100&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;)/SUM(numberB)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;The FORMAT of the varaible percent_ab could be forcing the appearance of decimals. If the format is something like 5.1 it will force the appearance of 1 decimal, showing a 0 when none are actually present.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 May 2016 14:32:26 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-05-03T14:32:26Z</dc:date>
    <item>
      <title>proc sql rounding percentage no decimals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-rounding-percentage-no-decimals/m-p/267958#M269359</link>
      <description>&lt;P&gt;Hi SAS Experts,&lt;/P&gt;
&lt;P&gt;I looked at the round function explanation and read that a ,1 should result in no decimals but my calculation reads 100,0 now and not just 100.&lt;BR /&gt;&lt;BR /&gt;proc sql ; &lt;BR /&gt;CREATE TABLE mytable AS&lt;BR /&gt;SELECT &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROUND((SUM(numberA)*100)/SUM(numberB),1) AS percent_ab&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; FROM aaaa;&lt;BR /&gt;QUIT;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 14:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-rounding-percentage-no-decimals/m-p/267958#M269359</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2016-05-03T14:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql rounding percentage no decimals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-rounding-percentage-no-decimals/m-p/267966#M269360</link>
      <description>&lt;P&gt;Not quite sure exactly what you mean by "calculation reads 100,0"&lt;/P&gt;
&lt;P&gt;Round is applied AFTER the results of&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;(SUM(numberA)*&lt;/FONT&gt;&lt;FONT color="#008080" face="SAS Monospace" size="2"&gt;100&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;)/SUM(numberB)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;The FORMAT of the varaible percent_ab could be forcing the appearance of decimals. If the format is something like 5.1 it will force the appearance of 1 decimal, showing a 0 when none are actually present.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 14:32:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-rounding-percentage-no-decimals/m-p/267966#M269360</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-03T14:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql rounding percentage no decimals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-rounding-percentage-no-decimals/m-p/267988#M269361</link>
      <description>&lt;P&gt;Well it's rounded but you're looking to control the display.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ; 
CREATE TABLE mytable AS
SELECT 
            ROUND((SUM(numberA)*100)/SUM(numberB),1) AS percent_ab format=8.
      FROM aaaa;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 May 2016 15:46:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-rounding-percentage-no-decimals/m-p/267988#M269361</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-03T15:46:28Z</dc:date>
    </item>
  </channel>
</rss>

