<?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 Report, Merging cells when grouped and vertical center in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Merging-cells-when-grouped-and-vertical-center/m-p/302710#M17100</link>
    <description>&lt;P&gt;So this is my dataset from using the ODS output with proc ttest:&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/5162iB51891C8C47B5B38/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="data.png" title="data.png" /&gt;&lt;/P&gt;
&lt;P&gt;This is my code so far for proc report&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options orientation=portrait;

ods rtf file="H:\temp.rtf" startpage=no nokeepn style=&amp;amp;mvSTYLE %wordstyle ;

proc report data=table3way headskip nowindows split='~'
	style(report)={font_size=9pt just=left cellpadding=2pt}
	style(header)={just=center font_weight=bold font_size=9pt background=CXE0E0E0}
	style(column)={cellheight=13pt font_size=9pt asis=on protectspecialchars=on}
	style(lines)={font_size=8pt asis=on};
		column dmtype Durationbi  Num cMean cSTD LowerCL UpperCL Probt;
		define dmtype/group style(column)=[vjust=middle just=left];
		define Durationbi /display;
		define num/display;
		define cMean/display format=9.2;
		define cSTD/display format=9.2;
		define LowerCL/display format=9.2;
		define UpperCL/display format=9.2;
		define Probt/group style(column)=[vjust=middle just=left];
	

	run;


footnote;title2;
ods rtf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And this is the RTF table I have based on the proc report above&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5163iE56160B7C5C5B1EB/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="table.png" title="table.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I &lt;STRONG&gt;want&lt;/STRONG&gt; the Type of Diabetes cell and p-value cell merged and vertically centered, so there is no blank cell under it, basically to look like this:&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/5164i65FE474963DAF433/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="want.png" title="want.png" /&gt;&lt;/P&gt;
&lt;P&gt;How do I do this? I did add the Vjust=middle option for the two variables... But I guess I have to add in another line of code somewhere to merge the cells? Can someone please help me?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did try looking at the solution outlined&amp;nbsp;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/Merging-Cells-Vertically-in-PROC-REPORT-RTF/td-p/265296" target="_self"&gt;here&lt;/A&gt;, but I don't have missing data (Someone suggested doing "If not missing(pvalue) then _pvalue=pvalue;&amp;nbsp;else pvalue=_pvalue; " I did try it with the retain function, but it didn't do anything since I didn't have missing data., so it pretty much copying the variable&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;
&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt;: I also tried adding the SPANROW option on the Proc report statment and order=data option on the define statement as outlined&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/34791887/sas-merging-cells-in-output-rtf-from-proc-report" target="_self"&gt;here&lt;/A&gt;. And it didn't work either. I am on SAS 9.4 and the option wasn't blue so unsure if it was removed between 9.2 to 9.4.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Oct 2016 16:07:48 GMT</pubDate>
    <dc:creator>Tpham</dc:creator>
    <dc:date>2016-10-05T16:07:48Z</dc:date>
    <item>
      <title>Proc Report, Merging cells when grouped and vertical center</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Merging-cells-when-grouped-and-vertical-center/m-p/302710#M17100</link>
      <description>&lt;P&gt;So this is my dataset from using the ODS output with proc ttest:&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/5162iB51891C8C47B5B38/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="data.png" title="data.png" /&gt;&lt;/P&gt;
&lt;P&gt;This is my code so far for proc report&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options orientation=portrait;

ods rtf file="H:\temp.rtf" startpage=no nokeepn style=&amp;amp;mvSTYLE %wordstyle ;

proc report data=table3way headskip nowindows split='~'
	style(report)={font_size=9pt just=left cellpadding=2pt}
	style(header)={just=center font_weight=bold font_size=9pt background=CXE0E0E0}
	style(column)={cellheight=13pt font_size=9pt asis=on protectspecialchars=on}
	style(lines)={font_size=8pt asis=on};
		column dmtype Durationbi  Num cMean cSTD LowerCL UpperCL Probt;
		define dmtype/group style(column)=[vjust=middle just=left];
		define Durationbi /display;
		define num/display;
		define cMean/display format=9.2;
		define cSTD/display format=9.2;
		define LowerCL/display format=9.2;
		define UpperCL/display format=9.2;
		define Probt/group style(column)=[vjust=middle just=left];
	

	run;


footnote;title2;
ods rtf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And this is the RTF table I have based on the proc report above&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5163iE56160B7C5C5B1EB/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="table.png" title="table.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I &lt;STRONG&gt;want&lt;/STRONG&gt; the Type of Diabetes cell and p-value cell merged and vertically centered, so there is no blank cell under it, basically to look like this:&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/5164i65FE474963DAF433/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="want.png" title="want.png" /&gt;&lt;/P&gt;
&lt;P&gt;How do I do this? I did add the Vjust=middle option for the two variables... But I guess I have to add in another line of code somewhere to merge the cells? Can someone please help me?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did try looking at the solution outlined&amp;nbsp;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/Merging-Cells-Vertically-in-PROC-REPORT-RTF/td-p/265296" target="_self"&gt;here&lt;/A&gt;, but I don't have missing data (Someone suggested doing "If not missing(pvalue) then _pvalue=pvalue;&amp;nbsp;else pvalue=_pvalue; " I did try it with the retain function, but it didn't do anything since I didn't have missing data., so it pretty much copying the variable&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;
&lt;P&gt;&lt;STRONG&gt;Edit&lt;/STRONG&gt;: I also tried adding the SPANROW option on the Proc report statment and order=data option on the define statement as outlined&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/34791887/sas-merging-cells-in-output-rtf-from-proc-report" target="_self"&gt;here&lt;/A&gt;. And it didn't work either. I am on SAS 9.4 and the option wasn't blue so unsure if it was removed between 9.2 to 9.4.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 16:07:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Merging-cells-when-grouped-and-vertical-center/m-p/302710#M17100</guid>
      <dc:creator>Tpham</dc:creator>
      <dc:date>2016-10-05T16:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report, Merging cells when grouped and vertical center</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Merging-cells-when-grouped-and-vertical-center/m-p/302813#M17101</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; When I run a slightly modified version of your code in SAS 9.4 M3, I do see the results you want with SPANROWS. Since you really are not grouping, I changed the usages to ORDER and DISPLAY.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here's the output:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5168i25E55CDC926DF9C4/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="spanrows_test.png" title="spanrows_test.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the code that produced the output (with a DATA step to make some fake data) is below.&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;P&gt;Here's the code:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data table3way;
  length dmtype durationbi $15;
  infile datalines dlm=',' dsd;
  input dmtype $ ordvar Durationbi $ Num cMean cSTD LowerCL UpperCL Probt;
return;
datalines;
"Type 1",1,"&amp;lt;=10 years",17,76.76,17.85,67.59,85.94,0.7243
"Type 1",2,"&amp;gt;10 year",44,75.30,13.06,71.32,79.27,0.7243
"Type 2",1,"&amp;lt;=10 years",47,67.23,22.22,44.44,88.88,0.5584
"Type 2",2,"&amp;gt;10 year",35,69.43,33.33,55.55,99.99,0.5584
;
run;

proc sort data=table3way;
  by  dmtype ordvar durationbi;
run;

options orientation=portrait;
  
ods html(id=ht) file="c:\temp\spantest_order_display.html";
ods rtf file="c:\temp\spantest_order_display.rtf"   ;
	
title "Using &amp;amp;sysvlong4 and different usage for the items, SPANROWS does work for PROBT";
proc report data=table3way  nowindows split='~' spanrows
	style(report)={font_size=9pt }
	style(header)={just=center font_weight=bold font_size=9pt background=CXE0E0E0}
	style(column)={font_size=9pt protectspecialchars=on};
		column dmtype Durationbi  Num cMean cSTD LowerCL UpperCL probt;
		define dmtype/order style(column)=[vjust=m just=l];
		define Durationbi /display;
		define num/display;
		define cMean/display  format=9.2;
		define cSTD/display format=9.2;
		define LowerCL/display format=9.2;
		define UpperCL/display format=9.2;
		define probt / order style(column)={vjust=m just=l};
	run;


footnote;title;
ods rtf close;
ods html(id=ht) close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Oct 2016 23:23:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Merging-cells-when-grouped-and-vertical-center/m-p/302813#M17101</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-10-05T23:23:37Z</dc:date>
    </item>
  </channel>
</rss>

