<?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: Show additional information in tabular cells in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294244#M60029</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; PROC REPORT won't put 2 tables side by side unless you use COLUMNS=2 for an ODS DESTINATION that supports the COLUMNS= option (RTF and PDF). What you want to do depends on&amp;nbsp; your destination to some extent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; PROC REPORT can calculate the same summary statistics that TABULATE can, except for KURTOSIS and SKEWNESS. But what if you wanted mean and pvalue and CSS or some other statistic from some other procedure. As long as you can create 1 dataset with all the information you want, then you can stack the data in the cell however you want, given that you use NEWLINE and ESCAPECHAR to insert the "line feed" into the appropriate place in the cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; For an example (well 3 examples, really) of a standard demographic report, please refer to #1 -- 2 examples on page 9, and #8 - pg 17 in this paper&amp;nbsp;&lt;A href="http://www2.sas.com/proceedings/forum2008/173-2008.pdf&amp;nbsp;" target="_blank"&gt;http://www2.sas.com/proceedings/forum2008/173-2008.pdf&amp;nbsp;&lt;/A&gt; and in #7-pg 24&amp;nbsp; in this paper &lt;A href="http://support.sas.com/resources/papers/proceedings16/SAS5762-2016.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings16/SAS5762-2016.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; To put 2 tables side by side, like this, you only need COLUMNS=2 -- here's a PDF example:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4719i88A74AA25165C288/image-size/original?v=v2&amp;amp;px=-1" alt="pdf_table.png" title="pdf_table.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;from the code below. Except for the style, the RTF output looks the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options orientation=landscape topmargin=.5in bottommargin=.5in
             leftmargin=.5in rightmargin=.5in nodate nonumber;
    
ods pdf file='c:\temp\twocol.pdf' columns=2;
ods rtf file='c:\temp\twocol.rtf' columns=2;

proc report data=sashelp.class;
  column age sex,(n height height=htpctn);
  define age / group;
  define sex / across;
  define n / 'Count';
  define height / mean 'Avg' f=6.2;
  define htpctn / pctn 'Pct' f=percent9.2;
  rbreak after / summarize;
run;
   
proc report data=sashelp.class;
  column age sex,(height height=htmax height=htmed);
  define age / group;
  define sex / across;
  define height / min 'Min';
  define htmax / max 'Max';
  define htmed / Median 'Median';
  rbreak after / summarize;
run;
ods _all_ close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 26 Aug 2016 01:21:59 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2016-08-26T01:21:59Z</dc:date>
    <item>
      <title>Show additional information in tabular cells</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/293086#M59967</link>
      <description>&lt;P&gt;Please see image below. &amp;nbsp;The inner cells contain frequencies.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to ADDITIONALLY include in each cell values for a &lt;STRONG&gt;third variable&lt;/STRONG&gt;, and even a fourth variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For instance, in addition to the 3231, I would like to see the average score, from, say,&amp;nbsp;Slope_5040x, and, say,&amp;nbsp;Slope_5050x.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4668i702B9269875A8164/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Proc Freq.png" title="Proc Freq.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My hunch is, Proc Freq is not the appropriate procedure to do what I am asking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Help and advice greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nicholas Kormanik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2016 09:57:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/293086#M59967</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2016-08-22T09:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Show additional information in tabular cells</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/293091#M59968</link>
      <description>&lt;P&gt;Any information on what that is? &amp;nbsp;Test data in the form of a datastep and what the output should look like help. &amp;nbsp;What is all the _date and _number things about? &amp;nbsp;If you have data like then then your best bet is to normalise it, i.e. don't have dates going across but have them in a column going down, and then use by &amp;lt;group&amp;gt;; &amp;nbsp;You can then transpose the results. &amp;nbsp;Proc means can do mean values and counts, and by &amp;lt;groups&amp;gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2016 10:28:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/293091#M59968</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-08-22T10:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Show additional information in tabular cells</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/293094#M59969</link>
      <description>&lt;P&gt;You probably want Proc tabulate but it won't be the same cell.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2016 10:32:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/293094#M59969</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-22T10:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Show additional information in tabular cells</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/293146#M59971</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; My guess is that if you can use PROC REPORT directly or you can "pre-process" your data in a DATA step. But whichever way, you have to insert the ESCAPECHAR command sequence for "newline" into the string you build.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider these examples.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4670i2D85225344CC99B9/image-size/original?v=v2&amp;amp;px=-1" alt="stack_variables_forum.png" title="stack_variables_forum.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2016 13:58:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/293146#M59971</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-08-22T13:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Show additional information in tabular cells</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294232#M60028</link>
      <description>&lt;P&gt;Thanks Cynthia. &amp;nbsp;Looks like Proc Report is perhaps the best way to show more information in table form. &amp;nbsp;So, a new proc to study.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even having a DIFFERENT table would be nice, showing information on another variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I mean is, each cell in the above table shows the &lt;STRONG&gt;frequency&lt;/STRONG&gt;, or number of observations in that cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Well, what is the &lt;STRONG&gt;mean&lt;/STRONG&gt; result for those observations? &amp;nbsp;Let's say, average score on some given test. &amp;nbsp;How did that particular group score?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would be nice to see that number in table form, too. &amp;nbsp;Maybe in a separate table. &amp;nbsp;So I can hold the two tables side by side. &amp;nbsp;And easily make comparisons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally it would be terrific to be able to place multiple measures/numbers into each cell. Perhaps with a legend at the bottom saying what the numbers represent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hopefully Proc Report can do this without too much fuss.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nicholas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 00:16:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294232#M60028</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2016-08-26T00:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Show additional information in tabular cells</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294244#M60029</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; PROC REPORT won't put 2 tables side by side unless you use COLUMNS=2 for an ODS DESTINATION that supports the COLUMNS= option (RTF and PDF). What you want to do depends on&amp;nbsp; your destination to some extent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; PROC REPORT can calculate the same summary statistics that TABULATE can, except for KURTOSIS and SKEWNESS. But what if you wanted mean and pvalue and CSS or some other statistic from some other procedure. As long as you can create 1 dataset with all the information you want, then you can stack the data in the cell however you want, given that you use NEWLINE and ESCAPECHAR to insert the "line feed" into the appropriate place in the cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; For an example (well 3 examples, really) of a standard demographic report, please refer to #1 -- 2 examples on page 9, and #8 - pg 17 in this paper&amp;nbsp;&lt;A href="http://www2.sas.com/proceedings/forum2008/173-2008.pdf&amp;nbsp;" target="_blank"&gt;http://www2.sas.com/proceedings/forum2008/173-2008.pdf&amp;nbsp;&lt;/A&gt; and in #7-pg 24&amp;nbsp; in this paper &lt;A href="http://support.sas.com/resources/papers/proceedings16/SAS5762-2016.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings16/SAS5762-2016.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; To put 2 tables side by side, like this, you only need COLUMNS=2 -- here's a PDF example:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4719i88A74AA25165C288/image-size/original?v=v2&amp;amp;px=-1" alt="pdf_table.png" title="pdf_table.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;from the code below. Except for the style, the RTF output looks the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options orientation=landscape topmargin=.5in bottommargin=.5in
             leftmargin=.5in rightmargin=.5in nodate nonumber;
    
ods pdf file='c:\temp\twocol.pdf' columns=2;
ods rtf file='c:\temp\twocol.rtf' columns=2;

proc report data=sashelp.class;
  column age sex,(n height height=htpctn);
  define age / group;
  define sex / across;
  define n / 'Count';
  define height / mean 'Avg' f=6.2;
  define htpctn / pctn 'Pct' f=percent9.2;
  rbreak after / summarize;
run;
   
proc report data=sashelp.class;
  column age sex,(height height=htmax height=htmed);
  define age / group;
  define sex / across;
  define height / min 'Min';
  define htmax / max 'Max';
  define htmed / Median 'Median';
  rbreak after / summarize;
run;
ods _all_ close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Aug 2016 01:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294244#M60029</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-08-26T01:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Show additional information in tabular cells</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294247#M60030</link>
      <description>&lt;P&gt;&lt;SPAN&gt;"PROC REPORT won't put 2 tables side by side unless you use COLUMNS=2 for an ODS DESTINATION that supports the COLUMNS= option."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cynthia, I wasn't saying to print on the same page. &amp;nbsp;I can print on two separate pages, no prob.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Just give me, please, SAS, two tables....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 01:52:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294247#M60030</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2016-08-26T01:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Show additional information in tabular cells</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294251#M60032</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Nice coding, Cynthia. &amp;nbsp;I'll try to use it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 02:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294251#M60032</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2016-08-26T02:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Show additional information in tabular cells</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294255#M60033</link>
      <description>To get multiple tables, from PROC REPORT, either use BY group processing to get a separate table for every BY group or use the PAGE option on the BREAK after.&lt;BR /&gt;&lt;BR /&gt;Otherwise, I am not sure what you mean when you plead for "just...two tables".&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Fri, 26 Aug 2016 04:01:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294255#M60033</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-08-26T04:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Show additional information in tabular cells</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294278#M60034</link>
      <description>&lt;P&gt;Cynthia, just as you've shown above. &amp;nbsp;That's what I want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ya did good, sweetheart.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 07:02:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294278#M60034</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2016-08-26T07:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Show additional information in tabular cells</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294288#M60035</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@NicholasKormanik wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ya did good, sweetheart.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Patronizing much?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 07:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294288#M60035</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-26T07:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Show additional information in tabular cells</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294310#M60037</link>
      <description>&lt;P&gt;Just showing appreciation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reeza, you do good, too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Love the help here. &amp;nbsp;You're all the best!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 08:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Show-additional-information-in-tabular-cells/m-p/294310#M60037</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2016-08-26T08:51:36Z</dc:date>
    </item>
  </channel>
</rss>

