<?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 add a row of total in proc  tabulate in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/add-a-row-of-total-in-proc-tabulate/m-p/615183#M179934</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am running proc tabulate code.&lt;/P&gt;
&lt;P&gt;It is working perfect.&lt;/P&gt;
&lt;P&gt;I just need to add a row of total (total column is already done in this code)&lt;/P&gt;
&lt;P&gt;What is the way to do it please?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc format;
value MisgCCFmt
0='a.0'
0-&amp;lt;4999.99='b.0-5K'
5000='c.5K'
5000-7500='d.5K-7.5K'
7500-10000='e.7.5K-10K'
10000-15000='f.10K-15K'
15000-20000='g.15K-20K'
20000-30000='h.20K-30K'
30000-50000='i.30K-50K'
50000-high='j.50K+'
;
run;


proc format;
value DropPCTFmt
-0.1-&amp;lt; 0='a.0 TO -10'
-0.2-&amp;lt; -0.1='b.-10 TO -20'
-0.3-&amp;lt; -0.2='c.-20 TO -30'
-0.4-&amp;lt; -0.3='d.-30 TO -40'
-0.5-&amp;lt; -0.4='e.-40 TO -50'
-0.6-&amp;lt; -0.5='f.-50 TO -60'
-0.7-&amp;lt; -0.6='g.-60 TO -70'
-0.8-&amp;lt; -0.7='h.-70 TO -80'
-0.9-&amp;lt; -0.8='i.-80 TO -90'
-0.95-&amp;lt; -0.9='j.-90 TO -95'
-0.99-&amp;lt; -0.95='k.-95 TO -99'
-1-&amp;lt; -0.99='l.-99 TO -100'
-1='m.-100'
;
run;


proc tabulate data=Raw_data(where=( YYY&amp;gt;5000 )) ;
class   YYY   PCT_DROP ;
var  ID;
table YYY=''*Customers=''*N=''*format=comma12. ,
       PCT_DROP="PCT_DROP"  all='TOTAL'/row=float box="misg_CC";
Format YYY   MisgCCFmt.     PCT_DROP   DropPCTFmt.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 05 Jan 2020 12:20:16 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2020-01-05T12:20:16Z</dc:date>
    <item>
      <title>add a row of total in proc  tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-a-row-of-total-in-proc-tabulate/m-p/615183#M179934</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am running proc tabulate code.&lt;/P&gt;
&lt;P&gt;It is working perfect.&lt;/P&gt;
&lt;P&gt;I just need to add a row of total (total column is already done in this code)&lt;/P&gt;
&lt;P&gt;What is the way to do it please?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc format;
value MisgCCFmt
0='a.0'
0-&amp;lt;4999.99='b.0-5K'
5000='c.5K'
5000-7500='d.5K-7.5K'
7500-10000='e.7.5K-10K'
10000-15000='f.10K-15K'
15000-20000='g.15K-20K'
20000-30000='h.20K-30K'
30000-50000='i.30K-50K'
50000-high='j.50K+'
;
run;


proc format;
value DropPCTFmt
-0.1-&amp;lt; 0='a.0 TO -10'
-0.2-&amp;lt; -0.1='b.-10 TO -20'
-0.3-&amp;lt; -0.2='c.-20 TO -30'
-0.4-&amp;lt; -0.3='d.-30 TO -40'
-0.5-&amp;lt; -0.4='e.-40 TO -50'
-0.6-&amp;lt; -0.5='f.-50 TO -60'
-0.7-&amp;lt; -0.6='g.-60 TO -70'
-0.8-&amp;lt; -0.7='h.-70 TO -80'
-0.9-&amp;lt; -0.8='i.-80 TO -90'
-0.95-&amp;lt; -0.9='j.-90 TO -95'
-0.99-&amp;lt; -0.95='k.-95 TO -99'
-1-&amp;lt; -0.99='l.-99 TO -100'
-1='m.-100'
;
run;


proc tabulate data=Raw_data(where=( YYY&amp;gt;5000 )) ;
class   YYY   PCT_DROP ;
var  ID;
table YYY=''*Customers=''*N=''*format=comma12. ,
       PCT_DROP="PCT_DROP"  all='TOTAL'/row=float box="misg_CC";
Format YYY   MisgCCFmt.     PCT_DROP   DropPCTFmt.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 Jan 2020 12:20:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-a-row-of-total-in-proc-tabulate/m-p/615183#M179934</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-01-05T12:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: add a row of total in proc  tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-a-row-of-total-in-proc-tabulate/m-p/615195#M179937</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems that the 'all' option is missing just before the comma in the TABLE Statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=Raw_data(where=( YYY&amp;gt;5000 )) ;
class   YYY   PCT_DROP Customers;
var  ID;
table YYY=''*Customers=''*N=''*format=comma12. all='TOTAL',
       PCT_DROP="PCT_DROP"  all='TOTAL'/row=float box="misg_CC";
Format YYY   MisgCCFmt.     PCT_DROP   DropPCTFmt.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 Jan 2020 15:07:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-a-row-of-total-in-proc-tabulate/m-p/615195#M179937</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-01-05T15:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: add a row of total in proc  tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-a-row-of-total-in-proc-tabulate/m-p/615548#M180053</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;When I add&amp;nbsp; all='Total'&amp;nbsp; before comma then I get&amp;nbsp; empty table and alert&amp;nbsp; "One or more tables in the report contains error".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 05:59:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-a-row-of-total-in-proc-tabulate/m-p/615548#M180053</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-01-07T05:59:50Z</dc:date>
    </item>
  </channel>
</rss>

