<?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: I'd like to create a simple table using proc freq, customize the labels and add column total. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/I-d-like-to-create-a-simple-table-using-proc-freq-customize-the/m-p/635560#M188730</link>
    <description>&lt;P&gt;Here is how you can do it with PROC FREQ and PROC REPORT:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.cars noprint;
   tables make / out=A;
run;

proc report data=A style(summary)=header;
   column make count;
   define make / order;
   define count / analysis 'Number';
   rbreak after / summarize;
   compute after;
      make = 'Total';
   endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your output will look like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PROC_REPORT_OUTPUT.JPG" style="width: 289px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37492i0BC940083CA1DFCC/image-size/large?v=v2&amp;amp;px=999" role="button" title="PROC_REPORT_OUTPUT.JPG" alt="PROC_REPORT_OUTPUT.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;After PROC PRINT and before PROC REPORT you can sort your MAKE variable as you want. (I am not sure why you would need 2 empty cells at the top of your table.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 28 Mar 2020 22:46:49 GMT</pubDate>
    <dc:creator>LeonidBatkhan</dc:creator>
    <dc:date>2020-03-28T22:46:49Z</dc:date>
    <item>
      <title>I'd like to create a simple table using proc freq, customize the labels and add column total.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-d-like-to-create-a-simple-table-using-proc-freq-customize-the/m-p/635545#M188723</link>
      <description>&lt;P&gt;I'm trying to do something simple but am struggling.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to create a simple one way frequency table with column total. I'd like to customize the order of the labels (not just by frequency) and change the Frequency label to Number.&amp;nbsp; So the table would look like this: Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Number&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Red&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Blue&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Green&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Total&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;18&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 18:58:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-d-like-to-create-a-simple-table-using-proc-freq-customize-the/m-p/635545#M188723</guid>
      <dc:creator>JenMMerc</dc:creator>
      <dc:date>2020-03-28T18:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: I'd like to create a simple table using proc freq, customize the labels and add column total.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-d-like-to-create-a-simple-table-using-proc-freq-customize-the/m-p/635548#M188725</link>
      <description>&lt;P&gt;Customizing the order is a bit more complicated, you can use ORDER=DATA to keep the order your data is in though. Sometimes if you need custom order you'll need to add another variable to control the order. Otherwise this is a pretty straightforward request, see below which replicates it for SASHELP.CLASS data set.&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.class;
class age;
table (age=''  all='Total'), N='Number';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/213591"&gt;@JenMMerc&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm trying to do something simple but am struggling.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to create a simple one way frequency table with column total. I'd like to customize the order of the labels (not just by frequency) and change the Frequency label to Number.&amp;nbsp; So the table would look like this: Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;Number&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Red&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Blue&lt;/TD&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Yellow&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Green&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Total&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;18&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 20:15:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-d-like-to-create-a-simple-table-using-proc-freq-customize-the/m-p/635548#M188725</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-28T20:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: I'd like to create a simple table using proc freq, customize the labels and add column total.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-d-like-to-create-a-simple-table-using-proc-freq-customize-the/m-p/635560#M188730</link>
      <description>&lt;P&gt;Here is how you can do it with PROC FREQ and PROC REPORT:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.cars noprint;
   tables make / out=A;
run;

proc report data=A style(summary)=header;
   column make count;
   define make / order;
   define count / analysis 'Number';
   rbreak after / summarize;
   compute after;
      make = 'Total';
   endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your output will look like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PROC_REPORT_OUTPUT.JPG" style="width: 289px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37492i0BC940083CA1DFCC/image-size/large?v=v2&amp;amp;px=999" role="button" title="PROC_REPORT_OUTPUT.JPG" alt="PROC_REPORT_OUTPUT.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;After PROC PRINT and before PROC REPORT you can sort your MAKE variable as you want. (I am not sure why you would need 2 empty cells at the top of your table.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 22:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-d-like-to-create-a-simple-table-using-proc-freq-customize-the/m-p/635560#M188730</guid>
      <dc:creator>LeonidBatkhan</dc:creator>
      <dc:date>2020-03-28T22:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: I'd like to create a simple table using proc freq, customize the labels and add column total.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-d-like-to-create-a-simple-table-using-proc-freq-customize-the/m-p/635564#M188731</link>
      <description>&lt;P&gt;This worked! Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 23:51:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-d-like-to-create-a-simple-table-using-proc-freq-customize-the/m-p/635564#M188731</guid>
      <dc:creator>JenMMerc</dc:creator>
      <dc:date>2020-03-28T23:51:14Z</dc:date>
    </item>
  </channel>
</rss>

