<?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: Remove Table1 from Table of Contents in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Remove-Table1-from-Table-of-Contents/m-p/577211#M23106</link>
    <description>&lt;P&gt;Thank you very much, Cynthia. Placing the dummy variable as the first thing in the COLUMN statement works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having other problems with the TOC. Can you take a look?&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/Text-truncated-in-RTF-Table-of-contents-amp-changes-of-font-face/m-p/577209" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/Text-truncated-in-RTF-Table-of-contents-amp-changes-of-font-face/m-p/577209&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 28 Jul 2019 05:52:02 GMT</pubDate>
    <dc:creator>luenhchang</dc:creator>
    <dc:date>2019-07-28T05:52:02Z</dc:date>
    <item>
      <title>Remove Table1 from Table of Contents</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Remove-Table1-from-Table-of-Contents/m-p/576799#M23097</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been successful in getting multiple tables exported to a single rtf file using ODS RTF and PROC REPORT. I am now trying to add a table of contents preceding the tables. I firstly tested the code with just a few tables. A TOC was generated with no problems. But Table 1 was placed right under the text that I specified with ODS PROCLABEL=. I then tried to remove the Table 1 using the code from&amp;nbsp;&lt;A href="http://support.sas.com/kb/31/278.html" target="_self"&gt;Problem Note 31278: Table 1 node generated by PROC REPORT&lt;/A&gt;&amp;nbsp;. The code worked. I then use the code in my script. Unfortunately, all the tables were split into one row per page. I think the problem is with the BREAK BEFORE. All my tables were displayed correctly (i.e. rows are not split) when I commented out the BREAK BEFORE statement but "Table 1" reappeared. I don't know how exactly the count variable works from the link.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code for my first table&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*---------------------------------------------------------------import data into SAS-------------------------------------------------------*/
data output.chapter2_tableSup&amp;amp;table_order.; 
	set &amp;amp;tData_uniVarBin_t1t2Count.	;
	gap01='';	
	gap02='';
	gap03='';
/*Create a variable to remove third node. This node iscontrolled by the BREAK BEFORE statement*/
	report_3rd_node_breaker=1;  
	OBSNO=_N_;
run;

/*--------------------------------Add titles and footnotes----------------------------------------------------------*/
proc sort data=	output.chapter2_tableSup&amp;amp;table_order.; by OBSNO report_3rd_node_breaker; run;

/*Get text for the 1st node of Table of Contents from a SAS macro variable
The first node is controlled with the ODS PROCLABEL statement. 
*/
ODS PROCLABEL="&amp;amp;&amp;amp;chapter2_suppTableContent&amp;amp;table_order."	;
 
title4 J=L /*this is the table title*/
		font='Times New Roman' 
		h=10pt 
		"&amp;amp;&amp;amp;chapter2_tableSuppTitle&amp;amp;table_order." 
	;  

/*-----------------------------------------------------------Add table body-----------------------------------------------------------*/
proc report	data=output.chapter2_tableSup&amp;amp;table_order.
					contents=""  /*Remove default 2nd node*/
					nowd 
					split='|'
					style(report)={width=100%  
								   cellpadding=8px
								   font_face='Times New Roman' 
								   font_size=10pt 
								   borderwidth=1.5pt /* border thickness*/ 
								   background = TRANSPARENT}
				    style(header)={just=left 
								   font_weight=bold 
								   font_face='Times New Roman' 
								   font_size=10pt 
								   font_style=roman 
								   protectspecialchars = OFF 
								   background = TRANSPARENT}
					 style(column)={font_face='Times New Roman' 
									font_size=10pt 
									background = TRANSPARENT}
     ;

/*The COLUMN statement is used to list each report column*/
column 	varGroup OBSNO report_3rd_node_breaker depVar  

	gap01 
	("\brdrb\brdrdot\brdrw5\brdrcf1 MZ twin pairs (twin1, twin2)" 
		twinCPair_MZ_0_0 twinCPair_MZ_0_1 twinCPair_MZ_1_0 twinCPair_MZ_1_1 	)

	gap02 
	("\brdrb\brdrdot\brdrw5\brdrcf1 DZ twin pairs (twin1, twin2)" 
		twinCPair_DZ_0_0 twinCPair_DZ_0_1 twinCPair_DZ_1_0 twinCPair_DZ_1_1 		)	

	gap03
	sum_completePairs	N_twinNonMissDepVar; 
    
%def_group(	cVar=varGroup	/*variable name*/
						,option=group			/*specify option=order if to order data alphabeticall; = group if not to order data*/
						,cName=Scale /*column header*/
						,cWide=2 cm	
						,headerAlign=left		/*alignment of header text in a column: left, center, right*/
						,colAlign=left 			/*alignment of content in a column: left, center, right, d (decimal point) */
						);

DEFINE OBSNO / ORDER NOPRINT;
DEFINE  report_3rd_node_breaker	/	ORDER NOPRINT;

%def_display(	cVar=depVar,							cName=Diagnosis,	 cWide=3.5 cm, headerAlign=left, colAlign=left);
%def_display(	cVar=twinCPair_MZ_0_0,	cName=(0, 0),	 cWide=1 cm,	headerAlign=right);
%def_display(	cVar=twinCPair_MZ_0_1,	cName=(0, 1),	 cWide=1 cm,	headerAlign=right);
%def_display(	cVar=twinCPair_MZ_1_0,	cName=(1, 0),	 cWide=1 cm,	headerAlign=right);
%def_display(	cVar=twinCPair_MZ_1_1,	cName=(1, 1),	 cWide=1 cm,	headerAlign=right);

%def_display(	cVar=twinCPair_DZ_0_0,	cName=(0, 0),	 cWide=1 cm,	headerAlign=right);
%def_display(	cVar=twinCPair_DZ_0_1,	cName=(0, 1),	 cWide=1 cm,	headerAlign=right);
%def_display(	cVar=twinCPair_DZ_1_0,	cName=(1, 0),	 cWide=1 cm,	headerAlign=right);
%def_display(	cVar=twinCPair_DZ_1_1,	cName=(1, 1),	 cWide=1 cm,	headerAlign=right);

%def_display(	cVar=sum_completePairs,	cName=Total twin pairs,	 cWide=2.5 cm,	headerAlign=right);	
%def_display(	cVar=N_twinNonMissDepVar,	cName=Total twin individuals,	 cWide=1.5 cm, headerAlign=right);

/*Define all the gap variables*/
%def_display(	cVar=gap01	,cName=			,isFmt=N	,cFmt=					,cWide=0.2%);
%def_display(	cVar=gap02	,cName=			,isFmt=N	,cFmt=					,cWide=0.2%);
%def_display(	cVar=gap03	,cName=			,isFmt=N	,cFmt=					,cWide=0.2%);

/*Add horitzontal lines under every occurence of dependent variable column*/
compute varGroup;
	if varGroup not="" then call define (_row_
															,'style'
															,'style={bordertopcolor=cyan bordertopwidth=1}');
endcomp;

compute after _page_ /style={just=l 
							 font_size=10pt 
							 font_face='Times New Roman'  
							 borderbottomcolor=white 
							 bordertopcolor=black};
endcomp;

break before report_3rd_node_breaker/ page contents=""; /*remove 3rd node*/
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the code for creating the RTF file with the table&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options	missing = ' '  	/*Specifies the character to print for missing numeric values.*/ 
			center 			/*Specifies whether to center or left align SAS procedure output*/
			nodate 			/*suppress default print of data time that this SAS program executed*/
			nonumber 	/*suppress default print of page number on first title line of each page*/
			orientation=	landscape /*orientation=portrait */
		;
TITLE1; TITLE2;
&lt;BR /&gt;options	bottommargin = 	2 cm 
   		topmargin = 			2 cm 
   		rightmargin = 			2 cm 
   		leftmargin = 			2 cm 
		; 

/*suppress the warning that a quoted string that exceeds 262 characters in length*/
options NOQUOTELENMAX ; 

/*Store table title text CSV file in SAS macro variables and values*/
%include	"&amp;amp;SAS_script_dir.\supp-table-title-text_to_SAS-macro-var.sas" ;
%include	"&amp;amp;SAS_script_dir.\import_supplementary-table_table-of-contents.sas" ; 

/* first tell ODS what character will be used as the ODS ESCAPECHAR character value*/
ods escapechar='~';
ods escapechar='^';

ods _all_ close; 
ods rtf file=		"&amp;amp;report_dir.\PhD-thesis_supplementary-tables_%sysfunc(date(), yymmdd10.).rtf" 
		style=		Journal
		contents 
		toc_data ; 
		 ; /*contents toc_data:  show table of contents*/
&lt;BR /&gt;/*Table S2-1*/
%let table_order	=	1;
%let tData_uniVarBin_t1t2Count=		output.manu1_count_twin_paris ; 
%let tScript_uniVarBin_t1t2Count=	Ch2_tabSup01_count-twin-pairs_binary-outcomes; 
%include	"&amp;amp;destin_script_dir.\&amp;amp;tScript_uniVarBin_t1t2Count..sas";
&lt;BR /&gt;/*------------------ close ODS RTF device----------------------------------------------------*/
ods rtf close;
ods listing;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I printscreened the first two pages in my RTF file. The TOC looks right. But Table S2-1 (10 rows) is split into 10 pages with just one row per page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table-of-contents.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31318iFB6AAC0616FFFFE8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="table-of-contents.png" alt="table-of-contents.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TableS2-1_1row_part1.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31319i0BDCB33B4A4D8D11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TableS2-1_1row_part1.png" alt="TableS2-1_1row_part1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TableS2-1_1row_part2.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31320iDEE6730279DB9357/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TableS2-1_1row_part2.png" alt="TableS2-1_1row_part2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I do have 10 rows in my SAS data set:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TableS2-1_SAS-dataset.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31321iA85D0BBD3C85C3CF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TableS2-1_SAS-dataset.png" alt="TableS2-1_SAS-dataset.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My table looks right after I commented out the BREAK BEFORE statement&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*break before report_3rd_node_breaker/ page contents=""; /*remove 3rd node*/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TableS2-1_entire-table.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31322iA5ACAA745E046C20/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TableS2-1_entire-table.png" alt="TableS2-1_entire-table.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But the unwanted Table1 appeared in my TOC:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table-of-contents_unwanted-table1.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31323iF554357B83E0CC98/image-size/medium?v=v2&amp;amp;px=400" role="button" title="table-of-contents_unwanted-table1.png" alt="table-of-contents_unwanted-table1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am looking forward to a solution/workaround. It would be great if someone can explain how the count variable works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Chang&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 07:37:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Remove-Table1-from-Table-of-Contents/m-p/576799#M23097</guid>
      <dc:creator>luenhchang</dc:creator>
      <dc:date>2019-07-26T07:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Table1 from Table of Contents</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Remove-Table1-from-Table-of-Contents/m-p/576896#M23102</link>
      <description>Hi:&lt;BR /&gt;  When I use this BREAK BEFORE technique I ALWAYS put the breaking variable first on the COLUMN statement, as shown in the Tech Support note....where the breaking variable is COUNT and COUNT is first on the COLUMN statement.&lt;BR /&gt;&lt;BR /&gt;You need this order because the breaking variable like COUNT or your report_3rd_node_breaker needs to be the first thing on the COLUMN statement to get rid of the Table 1 node. That was my understanding of why it needed to be a dummy/helper variable. Have you tried moving your breaking variable first???&lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
      <pubDate>Fri, 26 Jul 2019 13:28:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Remove-Table1-from-Table-of-Contents/m-p/576896#M23102</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-07-26T13:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Table1 from Table of Contents</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Remove-Table1-from-Table-of-Contents/m-p/577211#M23106</link>
      <description>&lt;P&gt;Thank you very much, Cynthia. Placing the dummy variable as the first thing in the COLUMN statement works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having other problems with the TOC. Can you take a look?&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/Text-truncated-in-RTF-Table-of-contents-amp-changes-of-font-face/m-p/577209" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/Text-truncated-in-RTF-Table-of-contents-amp-changes-of-font-face/m-p/577209&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2019 05:52:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Remove-Table1-from-Table-of-Contents/m-p/577211#M23106</guid>
      <dc:creator>luenhchang</dc:creator>
      <dc:date>2019-07-28T05:52:02Z</dc:date>
    </item>
  </channel>
</rss>

