<?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: SAS table with totals in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675892#M203702</link>
    <description>&lt;P&gt;Without any data, it is somewhat difficult to help you. Here is an example on how to count with proc summary:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.class;
   class Age;
   output out=work.counted(drop=_type_ rename=(_freq_=count));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In your case proc report seems to be a better tool:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=sashelp.class;
   columns Age Age=Count;
   
   define Age / group;
   define Count / n;
   
   rbreak after / summarize;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 11 Aug 2020 12:24:41 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2020-08-11T12:24:41Z</dc:date>
    <item>
      <title>SAS table with totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675879#M203692</link>
      <description>&lt;P&gt;hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am not sure whether to use group by or whether to use tabulate. Either way i'm not sure if those 2 are the correct options on how to do this:&lt;/P&gt;&lt;P&gt;I want to count the number of claims per region and get the total of all regions as follows:&lt;/P&gt;&lt;P&gt;Region&amp;nbsp; &amp;nbsp;Number&lt;/P&gt;&lt;P&gt;Pta&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/P&gt;&lt;P&gt;Jhb&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/P&gt;&lt;P&gt;Kzn&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/P&gt;&lt;P&gt;total&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 17&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 11:28:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675879#M203692</guid>
      <dc:creator>Citrine10</dc:creator>
      <dc:date>2020-08-11T11:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS table with totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675880#M203693</link>
      <description>&lt;P&gt;Show us your data please. Not just the desired result &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 11:30:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675880#M203693</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-08-11T11:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS table with totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675883#M203694</link>
      <description>&lt;P&gt;Use PROC SUMMARY&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#ProcSummaryRulez&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 11:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675883#M203694</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-11T11:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS table with totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675884#M203695</link>
      <description>hello. Not much in the data&lt;BR /&gt;just the claimid and the region column</description>
      <pubDate>Tue, 11 Aug 2020 11:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675884#M203695</guid>
      <dc:creator>Citrine10</dc:creator>
      <dc:date>2020-08-11T11:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS table with totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675885#M203696</link>
      <description>i dont want all the various stats. i just need a simple count with the total of those counts</description>
      <pubDate>Tue, 11 Aug 2020 11:52:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675885#M203696</guid>
      <dc:creator>Citrine10</dc:creator>
      <dc:date>2020-08-11T11:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS table with totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675890#M203700</link>
      <description>&lt;P&gt;You can use Proc Report . Group column will be&amp;nbsp;Region. Analysis column will be &lt;SPAN&gt;number of claim with sum statistics&amp;nbsp;and use rbreak statement for total sum.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 12:21:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675890#M203700</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2020-08-11T12:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: SAS table with totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675891#M203701</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/338030"&gt;@Citrine10&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;i dont want all the various stats. i just need a simple count with the total of those counts&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;PROC SUMMARY will do that, it only gives you the statistics you ask for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But really, you should show us a portion of the input data, and the exact output you want.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 12:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675891#M203701</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-11T12:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: SAS table with totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675892#M203702</link>
      <description>&lt;P&gt;Without any data, it is somewhat difficult to help you. Here is an example on how to count with proc summary:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.class;
   class Age;
   output out=work.counted(drop=_type_ rename=(_freq_=count));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In your case proc report seems to be a better tool:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=sashelp.class;
   columns Age Age=Count;
   
   define Age / group;
   define Count / n;
   
   rbreak after / summarize;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Aug 2020 12:24:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675892#M203702</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-08-11T12:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: SAS table with totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675894#M203703</link>
      <description>&lt;P&gt;You can Refer below code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Region  : $8.  Number;
datalines;
a 1
a 2
b 3
b 1
b 2
;
quit;

proc report data=have out=want(drop=_break_);
column Region   Number;
define Region/group;
define Number/analysis sum;
rbreak after/ol summarize;
 compute after;
      Region='Total:';
   endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Aug 2020 12:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675894#M203703</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2020-08-11T12:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS table with totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675900#M203709</link>
      <description>Thank you Andreas.&lt;BR /&gt;&lt;BR /&gt;is there a way to give the column a prefered name? At the moment the column header is called 'ClaimID' as thats the field name. I would like to call it 'Number of claims'</description>
      <pubDate>Tue, 11 Aug 2020 12:42:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/675900#M203709</guid>
      <dc:creator>Citrine10</dc:creator>
      <dc:date>2020-08-11T12:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS table with totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/676072#M203799</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/338030"&gt;@Citrine10&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you Andreas.&lt;BR /&gt;&lt;BR /&gt;is there a way to give the column a prefered name? At the moment the column header is called 'ClaimID' as thats the field name. I would like to call it 'Number of claims'&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just add the text in quotes to the define statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;define Count / n "Number of pupils";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Aug 2020 05:38:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-table-with-totals/m-p/676072#M203799</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-08-12T05:38:52Z</dc:date>
    </item>
  </channel>
</rss>

