<?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: Proc Report: Groups in Columns, Vars in Rows? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246894#M15171</link>
    <description>&lt;P&gt;Ksharp's got the closest solution, I think, but there's too many variables&amp;nbsp;and formatting changes inside the metrics to go this route. &amp;nbsp;For example, if I wanted to report a percent in one row and a dollar in the next.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Report works fine for summary reporting, except in this particular instance where ACROSS only groups the variables, rather than stacking them. &amp;nbsp;I'm not sure why that's not an option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The tabulate options here won't work with formatting, as the output needs to go to ODS and tabulate's formats don't usually carry to ODS and excel unless they're tagattr, then there's limits there too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, thanks everyone, I'll have to come up with a new solution.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jan 2016 14:15:02 GMT</pubDate>
    <dc:creator>wcp_fnfg</dc:creator>
    <dc:date>2016-01-29T14:15:02Z</dc:date>
    <item>
      <title>Proc Report: Groups in Columns, Vars in Rows?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246762#M15162</link>
      <description>&lt;P&gt;I am trying to get a proc report table (not tabulate, I need the formatting from report) that has the analysis variables stacked in rows under the columns, rather than as their own column.&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/1654i9C6F7FD70D0BAB3C/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Table Example.png" title="Table Example.png" /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code gets everything in the table, but I don't want the analysis split under each column header.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc report data=Sashelp.Class nowd ;&lt;BR /&gt;column Sex, (Weight height weight=n);&lt;BR /&gt;define Sex / across ' ' format=$sex. ;&lt;BR /&gt;define Age / across ;&lt;BR /&gt;define Weight / mean 'Mean Weight' ;&lt;BR /&gt;define Height / mean 'Mean Height' ;&lt;BR /&gt;define N / n 'Count' ;&lt;BR /&gt;run ;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12250iC5ACF52632319BB3/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Table Example.png" title="Table Example.png" /&gt;</description>
      <pubDate>Thu, 28 Jan 2016 21:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246762#M15162</guid>
      <dc:creator>wcp_fnfg</dc:creator>
      <dc:date>2016-01-28T21:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report: Groups in Columns, Vars in Rows?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246770#M15164</link>
      <description>I'd use other techniques to restructure the data into a simple summary dataset then use proc report to output.</description>
      <pubDate>Thu, 28 Jan 2016 22:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246770#M15164</guid>
      <dc:creator>BMiller</dc:creator>
      <dc:date>2016-01-28T22:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report: Groups in Columns, Vars in Rows?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246775#M15165</link>
      <description>&lt;P&gt;Can you specify what formatting you are referencing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example using a SAS supplied dataset of doing what you want with tabulate:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=sashelp.class;
   class sex;
   var height weight;
   tables (height='Mean height' weight='Mean weight') * mean=''*f=best5.
           n='Count',
           Sex=''
           / row=float;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jan 2016 23:04:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246775#M15165</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-28T23:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report: Groups in Columns, Vars in Rows?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246813#M15167</link>
      <description>&lt;P&gt;Yeah. You need to change the table structure if you have to use proc report. But I strongly recommend to use proc tabulate . It is not good for proc report for summary statistics .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
create table n as
 select sex,count(sex) as n
  from sashelp.class
   group by sex;
quit;
data class;
 set sashelp.class(keep=sex weight rename=(weight=value) in=ina) 
     sashelp.class(keep=sex height rename=(height=value) in=inb)
     n(keep=sex n rename=(n=value) in=inc);
length group $ 20;
if ina then group='Mean Weight';
if inb then group='Mean Height';
if inc then group='Count';
run;

proc report data=Class nowd ;
column group Sex,value;
define group/group ' ' order=data;
define Sex / across ' ';
define value/analysis mean ' ';
run ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Jan 2016 01:31:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246813#M15167</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-01-29T01:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report: Groups in Columns, Vars in Rows?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246881#M15170</link>
      <description>&lt;P&gt;PROC TABULATE is better for summaries. &amp;nbsp;In fact, I used the Summary Tables task in SAS Enterprise Guide to produce this, which includes some special appearance formatting. &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/1669i55BEFE5B8EB2F3C0/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="tab.png" title="tab.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code:&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
;
var weight height;
class sex / order=unformatted missing;
table /* row dimension */
    height={label="Mean Height"}*
        mean={label=""} 
        weight={label="Mean Weight"}*
        mean={label=""} 
        all={label="Count"}*
        n={label=""}*
         {style={font_weight=bold 
           font_style=roman 
           foreground=#ffffff background=#000080}},
        /* column dimension */
    sex={label=""}
    ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Jan 2016 13:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246881#M15170</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-01-29T13:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report: Groups in Columns, Vars in Rows?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246894#M15171</link>
      <description>&lt;P&gt;Ksharp's got the closest solution, I think, but there's too many variables&amp;nbsp;and formatting changes inside the metrics to go this route. &amp;nbsp;For example, if I wanted to report a percent in one row and a dollar in the next.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Report works fine for summary reporting, except in this particular instance where ACROSS only groups the variables, rather than stacking them. &amp;nbsp;I'm not sure why that's not an option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The tabulate options here won't work with formatting, as the output needs to go to ODS and tabulate's formats don't usually carry to ODS and excel unless they're tagattr, then there's limits there too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, thanks everyone, I'll have to come up with a new solution.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 14:15:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246894#M15171</guid>
      <dc:creator>wcp_fnfg</dc:creator>
      <dc:date>2016-01-29T14:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report: Groups in Columns, Vars in Rows?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246917#M15178</link>
      <description>&lt;P&gt;Then actual input data and desired output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tabulate does not like crossing statistics but different statistics in different rows or columns isn't an issue. Dollars are a matter of format. Admittedly percents might be an issue depending on percent of what but consider that Tabulate has specific pctn colpctn rowpctn pctsum colpctsum and rowpctsum summaries.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 15:45:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246917#M15178</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-29T15:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report: Groups in Columns, Vars in Rows?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246926#M15181</link>
      <description>&lt;P&gt;I have need to change format\metric\calculation per row, not within a row. &amp;nbsp;I appreciate the effort for the reply, but it doesn't help here. &amp;nbsp;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 16:18:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Groups-in-Columns-Vars-in-Rows/m-p/246926#M15181</guid>
      <dc:creator>wcp_fnfg</dc:creator>
      <dc:date>2016-01-29T16:18:52Z</dc:date>
    </item>
  </channel>
</rss>

