Hello,
I have been having an issue with controlling the nodes present in the TOC of SAS to RTF output. Specifically, for each table in my output I would only like 1 line in the TOC. I have read the discussion boards and I have tried using the contents = " " (quote-space-quote) or contents = "' (quote-quote) in the proc report statement as well as using ods proclabel. Please refer to the sample code below.
The TOC I am currently getting has 4 nodes in total. The first node is what I have set in the ods proclabel statement (i.e. "TABLE 1"). The second node is "Report". The third node is "dummy--col25" and the fourth node is "dummy-col35". Please refer to the photo below. I am not sure why I am getting the second node when I have set contents = " " and used ods proclabel. I believe I am getting node 3 and 4 because of the page option in the define statement for column col31 but I do not know how to suppress this.
Note: I am using the page option in the define statement for column col31 because I want col31-col35 to appear on a separate page.
options nodate nonumber nobyline;
ods listing close;
ods noresults;
ods proclabel = "TABLE 1";
ods escapechar = "~";
title; footnote;
title1 font = Calibri height = 10pt bold j = left "Title1";
title2 font = Calibri height = 10pt bold j = left "Title2" ;
title3 font = Calibri height = 10pt bold j = left "Title3" j = right "Title3.5";
footnote1 "~R'\brdrb\brdrs\brdrw8'";
footnote2 "Footnote1";
footnote3 "Footnote2";
footnote4 "Footnote3";
footnote5 "ProgramName" font = Calibri height = 10pt bold j = right "Page ~{thispage} of ~{lastpage}";
proc report data=dataset headline headskip nocenter missing split='`' nowindows contents="";
column ("~R'\brdrb\brdrs\brdrw8'" dummy neword num high_num1 sum_high var1 para
("Col 1`(N=%eval(&one))" "~R'\brdrb\brdrs\brdrw8'" col11 col12 col13 col14 col15)
("Col 2`(N=%eval(&two))" "~R'\brdrb\brdrs\brdrw8'" col21 col22 col23 col24 col25)
("Col 3`(N=%eval(&three))" "~R'\brdrb\brdrs\brdrw8'" col31 col32 col33 col34 col35));
define dummy / order noprint;
define neword / order order=internal noprint;
define num / order order=internal noprint;
define high_num1 / order order=internal descending noprint;
define sum_high / order order=internal descending noprint;
define var1 / order order=internal noprint;
define para / id order order=internal flow left "~R'\ql' Column Header" style(column)={cellwidth=33.5%};
define col11 / display center "~R'\qc' SubCol1" style(column)={cellwidth=6.5%};
define col12/ display center "~R'\qc' SubCol2" style(column)={cellwidth=6.5%};
define col13 / display center "~R'\qc' SubCol3" style(column)={cellwidth=6.5%};
define col14 / display center "~R'\qc' SubCol4" style(column)={cellwidth=6.5%};
define col15 / display center "~R'\qc' SubCol5" style(column)={cellwidth=6.5%};
define col21 / display center "~R'\qc' SubCol1" style(column)={cellwidth=6.5%};
define col22 / display center "~R'\qc' SubCol2" style(column)={cellwidth=6.5%};
define col23 / display center "~R'\qc' SubCol3" style(column)={cellwidth=6.5%};
define col24 / display center "~R'\qc' SubCol4" style(column)={cellwidth=6.5%};
define col25 / display center "~R'\qc' SubCol5" style(column)={cellwidth=6.5%};
define col31 / display center "~R'\qc' SubCol1" style(column)={cellwidth=13%} contents = "" page;
define col32 / display center "~R'\qc' SubCol2" style(column)={cellwidth=13%};
define col33 / display center "~R'\qc' SubCol3" style(column)={cellwidth=13%};
define col34 / display center "~R'\qc' SubCol4" style(column)={cellwidth=13%};
define col35 / display center "~R'\qc' SubCol5" style(column)={cellwidth=13%};
break after neword / ol summarize suppress skip;
break before dummy / contents="" page;
compute before _page_ ;
line "~S={just=c font=(Calibri) font_weight=bold}TABLE 1";
line "~S={just=c font=(Calibri) font_weight=bold}Title2";
endcomp ;
run;
ods tagsets.rtf close;
Using SAS 9.4