<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/913170#M359930</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From this table:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA SALE;

INPUT FILE $ TYPE $ VAR1 ;

CARDS;

1254 100A 52 
3652 200 36 
1254 100A 36 
3652 200 65 
3652 200 6 
2541 300 65 
;

RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I did a proc tabulate:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC TABULATE
DATA=SALE;	
	
	VAR VAR1;
	CLASS FILE /	ORDER=UNFORMATTED MISSING;
	TABLE

	/* Dimension de ligne */
FILE={LABEL=""},

/* Dimension de colonne */
VAR1*  Sum={LABEL=""}*F=BESTX12.

/* Options de la table */
/ BOX={LABEL="FILE"} 		;
	;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to achieve the following result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tabulate.png" style="width: 246px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93002iD7DDC95D2E81848B/image-size/large?v=v2&amp;amp;px=999" role="button" title="tabulate.png" alt="tabulate.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each file has the same type. As it is a character variable, I don't know how to integrate it into the proc tabulate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jan 2024 21:58:13 GMT</pubDate>
    <dc:creator>sasuser_8</dc:creator>
    <dc:date>2024-01-26T21:58:13Z</dc:date>
    <item>
      <title>proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/913170#M359930</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From this table:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA SALE;

INPUT FILE $ TYPE $ VAR1 ;

CARDS;

1254 100A 52 
3652 200 36 
1254 100A 36 
3652 200 65 
3652 200 6 
2541 300 65 
;

RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I did a proc tabulate:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC TABULATE
DATA=SALE;	
	
	VAR VAR1;
	CLASS FILE /	ORDER=UNFORMATTED MISSING;
	TABLE

	/* Dimension de ligne */
FILE={LABEL=""},

/* Dimension de colonne */
VAR1*  Sum={LABEL=""}*F=BESTX12.

/* Options de la table */
/ BOX={LABEL="FILE"} 		;
	;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to achieve the following result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tabulate.png" style="width: 246px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93002iD7DDC95D2E81848B/image-size/large?v=v2&amp;amp;px=999" role="button" title="tabulate.png" alt="tabulate.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each file has the same type. As it is a character variable, I don't know how to integrate it into the proc tabulate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 21:58:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/913170#M359930</guid>
      <dc:creator>sasuser_8</dc:creator>
      <dc:date>2024-01-26T21:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/913177#M359934</link>
      <description>&lt;P&gt;Unless there are other bits you aren't showing then perhaps this is more of a PROC Report item.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc report data=sale;
  columns file type var1;
  define file/group;
  define type/group;
  define var1 / 'sum_var1';
run;&lt;/PRE&gt;
&lt;P&gt;Report by default will sum numeric variables. You can see how to provide the column heading text other than the default variable label.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tabulate could look like this but aligning multiple row headings can be problematic if that is critical.&lt;/P&gt;
&lt;PRE&gt;PROC TABULATE DATA=SALE;	
	VAR VAR1;
	CLASS FILE /	ORDER=UNFORMATTED MISSING;
   class type;
	TABLE 	/* Dimension de ligne */
      FILE={LABEL=""} * type='',

      /* Dimension de colonne */
      VAR1*  Sum={LABEL=""}*F=BESTX12.

      /* Options de la table */
      / BOX={LABEL="FILE  Type"} 		;
run;&lt;/PRE&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;</description>
      <pubDate>Fri, 26 Jan 2024 23:07:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/913177#M359934</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-01-26T23:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/913395#M360029</link>
      <description>&lt;P&gt;Ok thank you, the PROC REPORT is effectively simpler.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 14:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate/m-p/913395#M360029</guid>
      <dc:creator>sasuser_8</dc:creator>
      <dc:date>2024-01-29T14:01:00Z</dc:date>
    </item>
  </channel>
</rss>

