<?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 How to add a “cumulative percent” column without losing the visual features of the PROC TABULATE? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-a-cumulative-percent-column-without-losing-the-visual/m-p/407378#M67054</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am Julian and I need to produce a table that shows the layout you can see in this picture.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="foto tabla.JPG" style="width: 480px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16220i908518D193951FB8/image-size/large?v=v2&amp;amp;px=999" role="button" title="foto tabla.JPG" alt="foto tabla.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the following PROC TABULATE program in SAS Enterprise Guide 7.1 – 32 bits I’ve been able to produce all the &amp;nbsp;columns except for the “&lt;EM&gt;Cumulative % of the Sum_Var2&lt;/EM&gt;” one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC TABULATE DATA= Julian.Mydata NOSEPS ;
         TITLE1 'Table 3';
   WEIGHT weight_var;
   CLASS  category_var / PRELOADFMT EXCLUSIVE;
   VAR Var1 Var2;
         TABLE (ALL='TOTAL' category_var=' '),
               (SUM='Sum_Var1'*Var1=' '*ALL=' '*F=COMMAX16.0
     SUM='Sum_Var2'*Var2=' '*F=dollar16.0
     MEAN='Mean_Var2'*Var2=' '*F=dollar16.0
     COLPCTSUM='% of the Sum_Var2'*Var2=' ')
      /RTS=25 PRINTMISS BOX='Categories' CONDENSE;
FORMAT category_var category_var.;
FOOTNOTE 'Source';
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Do you know a method to create that column without losing the visual features of the PROC TABULATE?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks. I will be looking forward to your help.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Oct 2017 17:23:15 GMT</pubDate>
    <dc:creator>jaecheverrys</dc:creator>
    <dc:date>2017-10-25T17:23:15Z</dc:date>
    <item>
      <title>How to add a “cumulative percent” column without losing the visual features of the PROC TABULATE?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-a-cumulative-percent-column-without-losing-the-visual/m-p/407378#M67054</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am Julian and I need to produce a table that shows the layout you can see in this picture.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="foto tabla.JPG" style="width: 480px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16220i908518D193951FB8/image-size/large?v=v2&amp;amp;px=999" role="button" title="foto tabla.JPG" alt="foto tabla.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the following PROC TABULATE program in SAS Enterprise Guide 7.1 – 32 bits I’ve been able to produce all the &amp;nbsp;columns except for the “&lt;EM&gt;Cumulative % of the Sum_Var2&lt;/EM&gt;” one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC TABULATE DATA= Julian.Mydata NOSEPS ;
         TITLE1 'Table 3';
   WEIGHT weight_var;
   CLASS  category_var / PRELOADFMT EXCLUSIVE;
   VAR Var1 Var2;
         TABLE (ALL='TOTAL' category_var=' '),
               (SUM='Sum_Var1'*Var1=' '*ALL=' '*F=COMMAX16.0
     SUM='Sum_Var2'*Var2=' '*F=dollar16.0
     MEAN='Mean_Var2'*Var2=' '*F=dollar16.0
     COLPCTSUM='% of the Sum_Var2'*Var2=' ')
      /RTS=25 PRINTMISS BOX='Categories' CONDENSE;
FORMAT category_var category_var.;
FOOTNOTE 'Source';
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Do you know a method to create that column without losing the visual features of the PROC TABULATE?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks. I will be looking forward to your help.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 17:23:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-a-cumulative-percent-column-without-losing-the-visual/m-p/407378#M67054</guid>
      <dc:creator>jaecheverrys</dc:creator>
      <dc:date>2017-10-25T17:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a “cumulative percent” column without losing the visual features of the PROC TABULATE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-a-cumulative-percent-column-without-losing-the-visual/m-p/407460#M67058</link>
      <description>&lt;P&gt;If you are attempting what I think you want then you can't do that in Tabulate as a single step. The percent calculations have to use either the n or sum of a table, row or column and cannot do sum or row1 and row2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you may have to presummarize everything. Without specific data and actual expectation I can't get more specific for suggestions on how.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 20:28:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-a-cumulative-percent-column-without-losing-the-visual/m-p/407460#M67058</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-25T20:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a “cumulative percent” column without losing the visual features of the PROC TABULATE</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-add-a-cumulative-percent-column-without-losing-the-visual/m-p/407481#M67059</link>
      <description>&lt;P&gt;You could use ODS OUTPUT to write the tabulate table to a dataset.&amp;nbsp; Then create the &lt;EM&gt;&lt;STRONG&gt;cum_pct&lt;/STRONG&gt;&lt;/EM&gt; var from the &lt;EM&gt;&lt;STRONG&gt;PCT&lt;/STRONG&gt;&lt;/EM&gt; var, followed by a proc print.&amp;nbsp; Here's a schematic:&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;&lt;BR /&gt;ods output tabulate.report.table=MYTABLE;
proc tabulate data=mydata ;
  class ...;
  var ...;
  table .... ;
run;
ods output close;

/* Assume the pct var name is var2_pctsum_0_var2 */
data want;
  set mytable;
  cumpct+var2-pctsum_0_var2;
run;

proc print data=want;
....
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Oct 2017 21:25:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-add-a-cumulative-percent-column-without-losing-the-visual/m-p/407481#M67059</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-10-25T21:25:18Z</dc:date>
    </item>
  </channel>
</rss>

