<?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 proc tabulate SUM row in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-SUM-row/m-p/781038#M248915</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;In the following proc&amp;nbsp; tabulate I get an error related to the following statements:&lt;/P&gt;
&lt;P&gt;1-&amp;nbsp;&amp;nbsp;&lt;CODE class="  language-sas"&gt;all&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'TOTAL2'&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;SUM&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;''&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;2-&amp;nbsp;&amp;nbsp;&lt;CODE class="  language-sas"&gt;all&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'TOTAL2'&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;rowpctn&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;''&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class="  language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token string"&gt;May&amp;nbsp;anyone&amp;nbsp;help&amp;nbsp;to&amp;nbsp;fix&amp;nbsp;the&amp;nbsp;error&amp;nbsp;please?&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title;
proc tabulate data=sashelp.cars  out=want_a1(drop=_type_ _page_ _table_) format=comma21. MISSING;
 class origin    Type /order=formatted ;
 VAR  invoice;
table (origin='' All='Total1')
      , (Type='Car Type' )*(n=''*f=comma21.) all='TOTAL2'*N='' / rts=10 box='Factory Location'  misstext='0'  style=[pretext='Number of transactions'];

table (origin='' All='Total1')
      , (Type='Car Type' )*(rowpctn=''*f=comma21.1) all='TOTAL2'*rowpctn='' / rts=10 box='Factory Location'  misstext='0'  style=[pretext='Tamhil Number of transactions'];

table (origin='' All='Total1')
      , (Type='Car Type' )*(invoice=''*SUM=''*f=comma21.1)  all='TOTAL2'*SUM=''  / rts=10 box='Factory Location'  misstext='0'  style=[pretext='SUM Haamadot MLS'];

 table (origin='' All='Total1')
      , (Type='Car Type' )*(invoice=''*rowpctsum=''*f=comma21.1)  all='TOTAL2'*rowpctsum=''   / rts=10 box='Factory Location'  misstext='0'  style=[pretext='Tamhil Sum Haamadot'];
run; 
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Nov 2021 14:38:55 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2021-11-18T14:38:55Z</dc:date>
    <item>
      <title>proc tabulate SUM row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-SUM-row/m-p/781038#M248915</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;In the following proc&amp;nbsp; tabulate I get an error related to the following statements:&lt;/P&gt;
&lt;P&gt;1-&amp;nbsp;&amp;nbsp;&lt;CODE class="  language-sas"&gt;all&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'TOTAL2'&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;SUM&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;''&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;2-&amp;nbsp;&amp;nbsp;&lt;CODE class="  language-sas"&gt;all&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'TOTAL2'&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;rowpctn&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;''&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class="  language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token string"&gt;May&amp;nbsp;anyone&amp;nbsp;help&amp;nbsp;to&amp;nbsp;fix&amp;nbsp;the&amp;nbsp;error&amp;nbsp;please?&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title;
proc tabulate data=sashelp.cars  out=want_a1(drop=_type_ _page_ _table_) format=comma21. MISSING;
 class origin    Type /order=formatted ;
 VAR  invoice;
table (origin='' All='Total1')
      , (Type='Car Type' )*(n=''*f=comma21.) all='TOTAL2'*N='' / rts=10 box='Factory Location'  misstext='0'  style=[pretext='Number of transactions'];

table (origin='' All='Total1')
      , (Type='Car Type' )*(rowpctn=''*f=comma21.1) all='TOTAL2'*rowpctn='' / rts=10 box='Factory Location'  misstext='0'  style=[pretext='Tamhil Number of transactions'];

table (origin='' All='Total1')
      , (Type='Car Type' )*(invoice=''*SUM=''*f=comma21.1)  all='TOTAL2'*SUM=''  / rts=10 box='Factory Location'  misstext='0'  style=[pretext='SUM Haamadot MLS'];

 table (origin='' All='Total1')
      , (Type='Car Type' )*(invoice=''*rowpctsum=''*f=comma21.1)  all='TOTAL2'*rowpctsum=''   / rts=10 box='Factory Location'  misstext='0'  style=[pretext='Tamhil Sum Haamadot'];
run; 
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 14:38:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-SUM-row/m-p/781038#M248915</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-11-18T14:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate SUM row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-SUM-row/m-p/781057#M248919</link>
      <description>&lt;P&gt;The ENTIRE LOG would be helpful. "An error" is really not very descriptive.&lt;/P&gt;
&lt;P&gt;If it hadn't been for use of a SAS supplied data set you would have to provide such which gets:&lt;/P&gt;
&lt;PRE&gt;16   proc tabulate data=sashelp.cars   format=comma21. MISSING;
17    class origin    Type /order=formatted ;
18    VAR  invoice;
19   table (origin='' All='Total1')
20         , (Type='Car Type' )*(n=''*f=comma21.) all='TOTAL2'*N='' / rts=10 box='Factory
20 ! Location'  misstext='0'  style=[pretext='Number of transactions'];
21
22   table (origin='' All='Total1')
23         , (Type='Car Type' )*(rowpctn=''*f=comma21.1) all='TOTAL2'*rowpctn='' / rts=10
23 ! box='Factory Location'  misstext='0'  style=[pretext='Tamhil Number of transactions'];
24
25   table (origin='' All='Total1')
26         , (Type='Car Type' )*(invoice=''*SUM=''*f=comma21.1)  all='TOTAL2'*SUM=''  / rts=10
26 ! box='Factory Location'  misstext='0'  style=[pretext='SUM Haamadot MLS'];
27
28    table (origin='' All='Total1')
29         , (Type='Car Type' )*(invoice=''*rowpctsum=''*f=comma21.1)  all='TOTAL2'*rowpctsum=''
29 !  / rts=10 box='Factory Location'  misstext='0'  style=[pretext='Tamhil Sum Haamadot'];
30   run;

ERROR: Statistic other than N was requested&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt; without analysis variable&lt;/STRONG&gt; &lt;/FONT&gt;in the following nesting :
       Origin * All * Sum.
ERROR: Statistic other than N was requested without analysis variable in the following nesting :
       All * All * Sum.
&lt;/PRE&gt;
&lt;P&gt;Which is because you ask for SUM and PCTSUM without the variable.&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=sashelp.cars   format=comma21. MISSING;
 class origin    Type /order=formatted ;
 VAR  invoice;
table (origin='' All='Total1')
      , (Type='Car Type' )*(n=''*f=comma21.) all='TOTAL2'*N='' 
     / rts=10 box='Factory Location'  misstext='0'  
      style=[pretext='Number of transactions'];

table (origin='' All='Total1')
      , (Type='Car Type' )*(rowpctn=''*f=comma21.1) all='TOTAL2'*rowpctn='' 
    / rts=10 box='Factory Location'  misstext='0'  
      style=[pretext='Tamhil Number of transactions'];

table (origin='' All='Total1')
      , (Type='Car Type' )*(invoice=''*SUM=''*f=comma21.1)  all='TOTAL2'&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;*invoice&lt;/STRONG&gt;&lt;/FONT&gt;*SUM='' 
      / rts=10 box='Factory Location'  misstext='0'  
        style=[pretext='SUM Haamadot MLS'];

 table (origin='' All='Total1')
      , (Type='Car Type' )*(invoice=''*rowpctsum=''*f=comma21.1)  all='TOTAL2'&lt;FONT size="5" color="#FF0000"&gt;*invoice&lt;/FONT&gt;*rowpctsum=''   
      / rts=10 box='Factory Location'  misstext='0'  
     style=[pretext='Tamhil Sum Haamadot'];
run; &lt;/PRE&gt;
&lt;P&gt;The statistics like Sum and Pctsum need to know which variable(s) are to be summed or similar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 16:38:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-SUM-row/m-p/781057#M248919</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-11-18T16:38:21Z</dc:date>
    </item>
  </channel>
</rss>

