<?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: how to use sas to calculate sum and percentage in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/244289#M45506</link>
    <description>&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;the original table that I work on is generated by SAS macro.&lt;/P&gt;&lt;P&gt;It is hard for me to combine transpose and macro. It would be helpful if you have sample sas code that works with transpose and macro&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jan 2016 20:15:31 GMT</pubDate>
    <dc:creator>Bal23</dc:creator>
    <dc:date>2016-01-18T20:15:31Z</dc:date>
    <item>
      <title>how to use sas to calculate sum and percentage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/243841#M45386</link>
      <description>&lt;P&gt;I have geneated a table (attached). In stead of calculate it by excel, i hope i can get advice from you to write a code to calculate sum and percentage to generate another table (desired, attached)&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 17:23:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/243841#M45386</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-20T17:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to use sas to calculate sum and percentage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/243842#M45387</link>
      <description>&lt;P&gt;and the desired table (sample calculation) attached&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2016 17:24:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/243842#M45387</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-20T17:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to use sas to calculate sum and percentage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/243857#M45395</link>
      <description>&lt;P&gt;Assuming that you desired is not complete, ther should be percentages throughout the matrix, right?&lt;/P&gt;
&lt;P&gt;It seems that you have cross tabulation as input, which is not optimal when creating reports.&lt;/P&gt;
&lt;P&gt;Try to transpose your table to look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Id - Category - Year - Value (Freq?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After that, you can use PROC TABULATE to do a cross&amp;nbsp;tabulation with %, sum and more.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 17:57:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/243857#M45395</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-01-15T17:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to use sas to calculate sum and percentage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/243930#M45415</link>
      <description>&lt;P&gt;Why does your "desired" include so many blank cells? If you dont' want to calculate all of the results provide a smaller input example set, the principles for the solution would remain the same and be clearer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is your sample data actually your input data? I am willing to bet that it is much easier to work from the data you create that sample data from than that result.&lt;/P&gt;
&lt;P&gt;When I answered a VERY similar question&amp;nbsp;posted yesterday the first thing I had to do to the data was normalize it so that it was amenable to relatively simple summarization using proc tabulate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your data consisted of:&lt;/P&gt;
&lt;P&gt;Category&lt;/P&gt;
&lt;P&gt;Year&lt;/P&gt;
&lt;P&gt;and a categorical variable that indicated that the record is associated with a Child, Young, Seior or Widow person it is going to be much easier. Are you Counting or summing another variable to the the values displayed?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 21:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/243930#M45415</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-15T21:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to use sas to calculate sum and percentage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/244259#M45491</link>
      <description>&lt;P&gt;sorry I cannot understand this well. How to normalize it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I answered a VERY similar question&amp;nbsp;posted yesterday the first thing I had to do to the data was normalize it so that it was amenable to relatively simple summarization using proc tabulate.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2016 17:26:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/244259#M45491</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-18T17:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to use sas to calculate sum and percentage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/244262#M45493</link>
      <description>Doing a transpose as I suggested is a good start.</description>
      <pubDate>Mon, 18 Jan 2016 18:12:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/244262#M45493</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-01-18T18:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to use sas to calculate sum and percentage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/244289#M45506</link>
      <description>&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;the original table that I work on is generated by SAS macro.&lt;/P&gt;&lt;P&gt;It is hard for me to combine transpose and macro. It would be helpful if you have sample sas code that works with transpose and macro&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2016 20:15:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-use-sas-to-calculate-sum-and-percentage/m-p/244289#M45506</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-18T20:15:31Z</dc:date>
    </item>
  </channel>
</rss>

