<?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: How Do I Combine Rows in Proc Report in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-Do-I-Combine-Rows-in-Proc-Report/m-p/362895#M18728</link>
    <description>Hi, &lt;BR /&gt;  Thanks for showing your code, but you did not show ALL your code, including ODS statements -- do you want PDF or RTF output? Also, it is hard to replicate your results without any data. Someone might make some fake data, but it is just a guess as to what your work.data file looks like?&lt;BR /&gt;&lt;BR /&gt;  But even if you show the data, one of the issues is that PROC REPORT will want to span the left-most ORDER or GROUP items, but not the right-most items. I suspect that, if you changed your COLUMN statement like this:&lt;BR /&gt;column(test_info pooled_result further_calculations test individual_result ); so that pooled_result and further_calculations were moved to the left, next to test_info, that the spanning would be what you wanted, but the items would not appear in the order you want.&lt;BR /&gt;&lt;BR /&gt;You might investigate the report writing interface (RWI), because it allows for more control over row spanning and column spanning.&lt;BR /&gt; &lt;BR /&gt;cynthia</description>
    <pubDate>Tue, 30 May 2017 21:51:16 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2017-05-30T21:51:16Z</dc:date>
    <item>
      <title>How Do I Combine Rows in Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-Do-I-Combine-Rows-in-Proc-Report/m-p/362760#M18725</link>
      <description>&lt;P&gt;I need to create a report which contains information about a set of tests, individual results&amp;nbsp;from the&amp;nbsp;tests, and then a column containing the mean result for these tests, as in the format below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9135i8F084908EE4A6E59/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Wanted.PNG" title="Wanted.PNG" /&gt;&lt;/P&gt;&lt;P&gt;However, I am ending up with the result below:&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/9136iD4BAE80085BC1696/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Actual.PNG" title="Actual.PNG" /&gt;&lt;BR /&gt;As can be seen, this is fine before the individual test results, but the columns after them are not displaying as required. Is there a way of doing this without splitting the data out into multiple tables?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code that I am using for this is below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=data nofs spanrows split='*'
style(column)=[font=('Arial',9pt) vjust=middle]
style(header)=[font=('Arial',9pt,bold) background=_und_ vjust=middle]
style(report)=[cellpadding=3pt rules=all frame=box];
column(test_info test individual_result pooled_result further_calculations);

define test_info / order 'Test Information';
define test /  order 'Test';
define individual_result / order 'Individual Result';
define pooled_result / order 'Pooled Results';
define further_calculations / order 'Other Calculations Based on The Pooled Result';

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 15:24:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-Do-I-Combine-Rows-in-Proc-Report/m-p/362760#M18725</guid>
      <dc:creator>abbym</dc:creator>
      <dc:date>2017-05-30T15:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Combine Rows in Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-Do-I-Combine-Rows-in-Proc-Report/m-p/362895#M18728</link>
      <description>Hi, &lt;BR /&gt;  Thanks for showing your code, but you did not show ALL your code, including ODS statements -- do you want PDF or RTF output? Also, it is hard to replicate your results without any data. Someone might make some fake data, but it is just a guess as to what your work.data file looks like?&lt;BR /&gt;&lt;BR /&gt;  But even if you show the data, one of the issues is that PROC REPORT will want to span the left-most ORDER or GROUP items, but not the right-most items. I suspect that, if you changed your COLUMN statement like this:&lt;BR /&gt;column(test_info pooled_result further_calculations test individual_result ); so that pooled_result and further_calculations were moved to the left, next to test_info, that the spanning would be what you wanted, but the items would not appear in the order you want.&lt;BR /&gt;&lt;BR /&gt;You might investigate the report writing interface (RWI), because it allows for more control over row spanning and column spanning.&lt;BR /&gt; &lt;BR /&gt;cynthia</description>
      <pubDate>Tue, 30 May 2017 21:51:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-Do-I-Combine-Rows-in-Proc-Report/m-p/362895#M18728</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-05-30T21:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Combine Rows in Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-Do-I-Combine-Rows-in-Proc-Report/m-p/362963#M18729</link>
      <description>&lt;P&gt;Hi Cynthia,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for replying. The output I need is RTF, I have included the code I have used for this below. Unfortunately due to limitations within my company I'm not allowed to show any actual data so I just faked some data in the same format as what I need, hence why the tables were so generic! Again, the code used for that is below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's what I suspected, the data does need to be in the order specified above so I will investigate the RWI below (and let the person who requested it all be in one table know that it probably won't happen that way!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your help,&lt;/P&gt;&lt;P&gt;Abby&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data data;
input test_info $40. test individual_result pooled_result further_calculations;
datalines;
Multiple Columns Containing Information 1 1 1.5 5
Multiple Columns Containing Information 2 2 1.5 5
;
run;

options papersize=a4 orientation=portrait nonumber nodate;
ods rtf file="C:\Users\morelax5\Documents\Example Tables.doc" startpage=no style=MyStyleRTF;

goptions reset=all;
goptions device=zpng target=zpng xmax=8in ymax=5in hsize=8in vsize=5in xpixels=2880 ypixels=1800
rotate=portrait ftext='Arial' htext=11pt;
ods escapechar='~';

proc report data=data nofs spanrows split='*'
style(column)=[font=('Arial',9pt) vjust=middle]
style(header)=[font=('Arial',9pt,bold) background=_und_ vjust=middle]
style(report)=[cellpadding=3pt rules=all frame=box];
column(test_info test individual_result pooled_result further_calculations);

define test_info / order 'Test Information';
define test /  order 'Test';
define individual_result / order 'Individual Result';
define pooled_result / order 'Pooled Results';
define further_calculations / order 'Other Calculations Based on The Pooled Result';

run;

ods rtf close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 May 2017 08:45:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-Do-I-Combine-Rows-in-Proc-Report/m-p/362963#M18729</guid>
      <dc:creator>abbym</dc:creator>
      <dc:date>2017-05-31T08:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Combine Rows in Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-Do-I-Combine-Rows-in-Proc-Report/m-p/363064#M18731</link>
      <description>&lt;P&gt;apply &amp;nbsp;DISPLAY usage to the middle two variable ,not ORDER.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;define test /  display 'Test';
define individual_result / display 'Individual Result';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9153i864600AC6F123D72/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="x.png" title="x.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 13:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-Do-I-Combine-Rows-in-Proc-Report/m-p/363064#M18731</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-05-31T13:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Combine Rows in Proc Report</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-Do-I-Combine-Rows-in-Proc-Report/m-p/363072#M18732</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Odd, that's what I originally had and it didn't work which is why I changed them to order to see if it did. I've just tried again and it has worked!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 13:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-Do-I-Combine-Rows-in-Proc-Report/m-p/363072#M18732</guid>
      <dc:creator>abbym</dc:creator>
      <dc:date>2017-05-31T13:48:31Z</dc:date>
    </item>
  </channel>
</rss>

