<?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 report -Tamhil in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Tamhil/m-p/480783#M124272</link>
    <description>&lt;P&gt;Hi:&lt;BR /&gt; For a simple PCTSUM, you don't need to move to TABULATE, although that does give you more percent keyword choices. You only need to modify your PROC REPORT to use SALES again on the report, but not UNDER COUNTRY, as shown below:&lt;BR /&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
Proc report data=tbl nowd;
   columns Team Country,(sales=salespctsum) sales=tot sales=cpct;
   define Team/ group   ;
   define sales / sum;
   define Country/across 'Country Percent'  order=formatted ;
   define salespctsum / pctsum  format=percent9.1  ;
   define tot / 'Total';
   define cpct / pctsum format=percent9.1;
rbreak after/ summarize;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 24 Jul 2018 12:57:27 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2018-07-24T12:57:27Z</dc:date>
    <item>
      <title>Proc report -Tamhil</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Tamhil/m-p/480766#M124263</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I want create report using proc report.&lt;/P&gt;&lt;P&gt;Please see the code.&lt;/P&gt;&lt;P&gt;I want to add one more column of PCT from total for each team.&lt;/P&gt;&lt;P&gt;For category a we need to get 100/550=18%&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For category a we need to get 450/550=82%&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data tbl;
input ID  Team $ Country  $ sales;
cards;
1  a UK 10
2  a UK 20
3  a UK 30
4  a USA 40
5  b UK 50
6  b UK  60
7  b USA  70
8  b USA  80
9  b USA 90
10 b USA 100
;
run;
 Proc report data=tbl nowd;
   columns Team Country,(sales=salespctsum)  ;
   define Team/ group   ;
   define Country/across   order=formatted ;
   define salespctsum / pctsum  format=percent9.1  ;
rbreak after/ summarize;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jul 2018 11:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Tamhil/m-p/480766#M124263</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-07-24T11:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report -Tamhil</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Tamhil/m-p/480776#M124269</link>
      <description>&lt;P&gt;Since you want a summary table, why not using PROC TABULATE ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data tbl;
input ID  Team $ Country  $ sales;
cards;
1  a UK 10
2  a UK 20
3  a UK 30
4  a USA 40
5  b UK 50
6  b UK  60
7  b USA  70
8  b USA  80
9  b USA 90
10 b USA 100
;
run;
 Proc tabulate data=tbl ;
   class Team Country;
   var sales;
   table team all,country*sales*colpctsum=' ' sales='total'*pctsum=' ';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jul 2018 12:30:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Tamhil/m-p/480776#M124269</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-07-24T12:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report -Tamhil</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Tamhil/m-p/480783#M124272</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt; For a simple PCTSUM, you don't need to move to TABULATE, although that does give you more percent keyword choices. You only need to modify your PROC REPORT to use SALES again on the report, but not UNDER COUNTRY, as shown below:&lt;BR /&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
Proc report data=tbl nowd;
   columns Team Country,(sales=salespctsum) sales=tot sales=cpct;
   define Team/ group   ;
   define sales / sum;
   define Country/across 'Country Percent'  order=formatted ;
   define salespctsum / pctsum  format=percent9.1  ;
   define tot / 'Total';
   define cpct / pctsum format=percent9.1;
rbreak after/ summarize;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jul 2018 12:57:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Tamhil/m-p/480783#M124272</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-07-24T12:57:27Z</dc:date>
    </item>
  </channel>
</rss>

