<?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 OUTPUT in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/PROC-TABULATE-OUTPUT/m-p/609944#M18004</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;i am running a proc tabulate on a table as follows:&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="margin: 0px; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;STRONG&gt;&lt;SPAN style="margin: 0px; color: navy;"&gt;TABULATE&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&lt;FONT color="#000000"&gt; &lt;BR /&gt;&lt;/FONT&gt; &lt;/SPAN&gt;&lt;SPAN style="margin: 0px; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;DATA&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;FONT color="#000000"&gt;=la_rec.BIL_CTX_REF_HEBDO &lt;/FONT&gt;&lt;SPAN style="margin: 0px; color: blue;"&gt;out&lt;/SPAN&gt;&lt;FONT color="#000000"&gt;=work.tabs&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color="#000000"&gt; &lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/FONT&gt;&lt;SPAN style="margin: 0px; color: blue;"&gt;CLASS&lt;/SPAN&gt;&lt;FONT color="#000000"&gt; _CHARACTER_ / &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;SPAN style="margin: 0px; color: blue;"&gt;ORDER&lt;/SPAN&gt;&lt;FONT color="#000000"&gt;=UNFORMATTED &lt;/FONT&gt;&lt;SPAN style="margin: 0px; color: blue;"&gt;MISSING&lt;/SPAN&gt;&lt;FONT color="#000000"&gt;;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&lt;FONT color="#000000"&gt; &lt;BR /&gt;&lt;/FONT&gt; &lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/FONT&gt;&lt;SPAN style="margin: 0px; color: blue;"&gt;TABLE&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;_CHARACTER_,&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;PctN ;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;SPAN style="margin: 0px; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;RUN&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;i get as a result i get an outpu as follows:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tab1.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34504i01491F3DF28FA5AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="tab1.PNG" alt="tab1.PNG" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Howevere, i want to get the output well organized as follows :&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tab2.PNG" style="width: 521px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34505i5FC897586018C970/image-size/large?v=v2&amp;amp;px=999" role="button" title="tab2.PNG" alt="tab2.PNG" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;i will be so grateful for your help.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2019 13:17:13 GMT</pubDate>
    <dc:creator>aloou</dc:creator>
    <dc:date>2019-12-06T13:17:13Z</dc:date>
    <item>
      <title>PROC TABULATE OUTPUT</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-TABULATE-OUTPUT/m-p/609944#M18004</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;i am running a proc tabulate on a table as follows:&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="margin: 0px; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;STRONG&gt;&lt;SPAN style="margin: 0px; color: navy;"&gt;TABULATE&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&lt;FONT color="#000000"&gt; &lt;BR /&gt;&lt;/FONT&gt; &lt;/SPAN&gt;&lt;SPAN style="margin: 0px; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;DATA&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;FONT color="#000000"&gt;=la_rec.BIL_CTX_REF_HEBDO &lt;/FONT&gt;&lt;SPAN style="margin: 0px; color: blue;"&gt;out&lt;/SPAN&gt;&lt;FONT color="#000000"&gt;=work.tabs&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color="#000000"&gt; &lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/FONT&gt;&lt;SPAN style="margin: 0px; color: blue;"&gt;CLASS&lt;/SPAN&gt;&lt;FONT color="#000000"&gt; _CHARACTER_ / &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;SPAN style="margin: 0px; color: blue;"&gt;ORDER&lt;/SPAN&gt;&lt;FONT color="#000000"&gt;=UNFORMATTED &lt;/FONT&gt;&lt;SPAN style="margin: 0px; color: blue;"&gt;MISSING&lt;/SPAN&gt;&lt;FONT color="#000000"&gt;;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&lt;FONT color="#000000"&gt; &lt;BR /&gt;&lt;/FONT&gt; &lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/FONT&gt;&lt;SPAN style="margin: 0px; color: blue;"&gt;TABLE&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;_CHARACTER_,&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;PctN ;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="margin: 0px; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;SPAN style="margin: 0px; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;RUN&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="margin: 0px; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;i get as a result i get an outpu as follows:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tab1.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34504i01491F3DF28FA5AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="tab1.PNG" alt="tab1.PNG" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Howevere, i want to get the output well organized as follows :&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tab2.PNG" style="width: 521px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34505i5FC897586018C970/image-size/large?v=v2&amp;amp;px=999" role="button" title="tab2.PNG" alt="tab2.PNG" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;i will be so grateful for your help.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 13:17:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-TABULATE-OUTPUT/m-p/609944#M18004</guid>
      <dc:creator>aloou</dc:creator>
      <dc:date>2019-12-06T13:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TABULATE OUTPUT</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-TABULATE-OUTPUT/m-p/609950#M18005</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/232758"&gt;@aloou&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you try to modify you TABLE statement as follows:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;TABLE &lt;/SPAN&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;_CHARACTER_ * (&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;N&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;PctN) / ROW = FLOAT ;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 13:25:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-TABULATE-OUTPUT/m-p/609950#M18005</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-06T13:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TABULATE OUTPUT</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-TABULATE-OUTPUT/m-p/609953#M18006</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;i have tried what you have proposed but as an output i keep getting the same as this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tab1.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34506i99FF86A06EFAD021/image-size/large?v=v2&amp;amp;px=999" role="button" title="tab1.PNG" alt="tab1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 13:28:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-TABULATE-OUTPUT/m-p/609953#M18006</guid>
      <dc:creator>aloou</dc:creator>
      <dc:date>2019-12-06T13:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TABULATE OUTPUT</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-TABULATE-OUTPUT/m-p/609954#M18007</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/232758"&gt;@aloou&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you should add a preliminary step prior to proc tabulate in order to put all character variable values in the same variable, and then use this new variable as the class variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 13:32:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-TABULATE-OUTPUT/m-p/609954#M18007</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-06T13:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TABULATE OUTPUT</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-TABULATE-OUTPUT/m-p/609992#M18016</link>
      <description>&lt;P&gt;You will need to process the output data set created by proc tabulate.&lt;/P&gt;
&lt;P&gt;Here is an example using data you should have available.&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=sashelp.class out=work.tab ;
   class _character_;
   table _character_ , n pctn;
run;

OPTIONS Missing=' ';
data work.want;
   set work.tab (drop=_type_ _page_ _table_);
   newcol= cats(of _character_);
run;

options missing='.';

proc print data=work.want;
   var newcol n pctn_00;
run;

&lt;/PRE&gt;
&lt;P&gt;Elements you need to pay attention to:&lt;/P&gt;
&lt;P&gt;If you have missing CLASS variables that are numeric and want to use them and do not set OPTIONS MISSING=' '; then you will likely end up with . in the value of the newcol. The example shows only character but numeric class could be included. In which case you need to include the variable names&amp;nbsp;in the CATS function.&lt;/P&gt;
&lt;P&gt;You need to drop at least the _TYPE_ variable to use CATS(_CHARACTER_) because the _type_ is character. If you need to use the type, not unlikely at some point, then you will need to explicitly list the names of ALL of the variables you want to combine into a single column label.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use a tables statement with something like:&lt;/P&gt;
&lt;P&gt;Tables classvar1*Classvar2&lt;/P&gt;
&lt;P&gt;to create you row labels then you likely will want to use something like: Newcol = catx(' ',of _character_) or the list of variables to ensure that there is a space or desired separator between the columns of the row label values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also change the name/label for the statistic variables requested. The example above uses Pctn_00 because you can get different PCTN statistics and the digits following the PCTN will relate to the different versions. In which case you will likely have to do something else to combine rows. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also if you have PCTN and PCTSum in the same tabulate call or multiple TABLE statements you will likely have other manipulation issues involved.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 15:43:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-TABULATE-OUTPUT/m-p/609992#M18016</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-06T15:43:53Z</dc:date>
    </item>
  </channel>
</rss>

