<?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 tabulate-create 4 tables with same columns headers in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-create-4-tables-with-same-columns-headers/m-p/780496#M248704</link>
    <description>&lt;P&gt;You can get text to appear before a table using the table option Pretext&lt;/P&gt;
&lt;PRE&gt; table (origin='' All='Total')
      , (Type='' )*(n=''*f=comma21.) all='TOTAL2'*n='' 
      / rts=10   box='Origin of Factory'  misstext='0'
      style=[pretext='Number of transactions']
;&lt;/PRE&gt;
&lt;P&gt;Similar POSTTEXT will place text after the table similar to footnote and you can have both Pretext and Posttext for a single table. It only appears for that specific table. However, at least I haven't been able to, you don't have the text appearance options available that Title does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure exactly what you would expect for appearance with all the values suppressed in the columns. The value is what Tabulate uses to group values. You might get something that appears empty by setting the text color to the background color using a CLASSLEV statement.&lt;/P&gt;
&lt;P&gt;Or perhaps go to a different approach such as summarizing the data and then using the Report Writing Interface in a data step. Maybe.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Nov 2021 16:30:59 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-11-16T16:30:59Z</dc:date>
    <item>
      <title>Proc tabulate-create 4 tables with same columns headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-create-4-tables-with-same-columns-headers/m-p/780410#M248671</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;This proc tabulate is not working 100% as I want .&lt;/P&gt;
&lt;P&gt;I want to make the following changes:&lt;/P&gt;
&lt;P&gt;1-Remove column header&amp;nbsp; "N" and keep only the header 'Total2'&lt;/P&gt;
&lt;P&gt;2-I want to have only one row of columns headers (Instead of having it 4 times)&lt;/P&gt;
&lt;P&gt;3- Titles of each table are not correct as I asked to do.why?&lt;/P&gt;
&lt;P&gt;4-PCTSum total is not correct and should be 100.Why?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ronein_0-1637067566408.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65747i60D74210DC249B4F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ronein_0-1637067566408.png" alt="Ronein_0-1637067566408.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=sashelp.cars  out=want_a1(drop=_type_ _page_ _table_) format=comma21. MISSING;
 class origin    Type /order=formatted ;
 VAR  invoice;
 Title 'Number of transactions ';
 table (origin='' All='Total')
      , (Type='' )*(n=''*f=comma21.) all='TOTAL2' / rts=10   box='Origin of Factory'  misstext='0';

 Title 'PCT of Number of transactions ';
  table (origin='' All='Total')
      , (Type='' )*(rowpctn=''*f=comma21.1) rowpctn*all='TOTAL2' / rts=10   box='Origin of Factory'  misstext='0';


Title 'Sum invoices';
  table (origin='' All='Total')
      , (Type='' )*(invoice=''*SUM=''*f=comma21.1) all='TOTAL2' / rts=10   box='Origin of Factory'  misstext='0';

Title 'PCT sum of invoices';
  table (origin='' All='Total')
      , (Type='' )*(invoice=''*rowpctsum=''*f=comma21.1) all='TOTAL2' / rts=10 box='Origin of Factory'  misstext='0';
run; 

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 15:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-create-4-tables-with-same-columns-headers/m-p/780410#M248671</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-11-16T15:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate-create 4 tables with same columns headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-create-4-tables-with-same-columns-headers/m-p/780479#M248696</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1-Remove column header&amp;nbsp; "N" and keep only the header 'Total2'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;all='TOTAL2'*N=''&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2-I want to have only one row of columns headers (Instead of having it 4 times)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No idea&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;3- Titles of each table are not correct as I asked to do.why?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Title is only output &lt;STRONG&gt;once&lt;/STRONG&gt; at the top. I suspect it's above the screenshot you've shown and the remainder are the automatic titles from SAS that need to be turned off.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;4-PCTSum total is not correct and should be 100.Why?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The column you've highlighted is the ALL which doesn't have PCTSUM applied to it, only the default N. If you add it, does it give you what you want?&lt;/P&gt;
&lt;PRE&gt;  table (origin='' All='Total')
      , (Type='' )*(invoice=''*&lt;FONT size="4" color="#33CCCC"&gt;&lt;STRONG&gt;rowpctsum&lt;/STRONG&gt;&lt;/FONT&gt;=''*f=comma21.1) &lt;FONT color="#33CCCC"&gt;&lt;STRONG&gt;all='TOTAL2'&lt;FONT color="#FF9900"&gt;*rowpctsum&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; / rts=10 box='Origin of Factory'  misstext='0';&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 15:48:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-create-4-tables-with-same-columns-headers/m-p/780479#M248696</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-11-16T15:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate-create 4 tables with same columns headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-create-4-tables-with-same-columns-headers/m-p/780496#M248704</link>
      <description>&lt;P&gt;You can get text to appear before a table using the table option Pretext&lt;/P&gt;
&lt;PRE&gt; table (origin='' All='Total')
      , (Type='' )*(n=''*f=comma21.) all='TOTAL2'*n='' 
      / rts=10   box='Origin of Factory'  misstext='0'
      style=[pretext='Number of transactions']
;&lt;/PRE&gt;
&lt;P&gt;Similar POSTTEXT will place text after the table similar to footnote and you can have both Pretext and Posttext for a single table. It only appears for that specific table. However, at least I haven't been able to, you don't have the text appearance options available that Title does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure exactly what you would expect for appearance with all the values suppressed in the columns. The value is what Tabulate uses to group values. You might get something that appears empty by setting the text color to the background color using a CLASSLEV statement.&lt;/P&gt;
&lt;P&gt;Or perhaps go to a different approach such as summarizing the data and then using the Report Writing Interface in a data step. Maybe.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 16:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-create-4-tables-with-same-columns-headers/m-p/780496#M248704</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-11-16T16:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate-create 4 tables with same columns headers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-create-4-tables-with-same-columns-headers/m-p/780758#M248794</link>
      <description>&lt;P&gt;Great and thanks,&lt;/P&gt;
&lt;P&gt;However there are some problems:&lt;/P&gt;
&lt;P&gt;1-This statement is not working and get an error&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt; all='TOTAL2'*SUM=''&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;2-This statement is not working and get an error&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt; all='TOTAL2'*rowpctn=''&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 15:24:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-create-4-tables-with-same-columns-headers/m-p/780758#M248794</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-11-17T15:24:15Z</dc:date>
    </item>
  </channel>
</rss>

