In the ods rtf output, I want to include contents inside.
below is my code and I got output like this:
Actually I only want to keep red marked part. I want to replace the blue marked text, using "Contents" instead of "Table of contents"
In addition, I want to change the font size and style of contents.
How can I revise my code?
Thanks
"
ods rtf file='XXXXX\try.rtf' contents=yes toc_data bodytitle;
options nobyline;
proc sort data=sashelp.class out=class; by sex; run;
proc report data=class nowindows contents='table1: aaaaaaaaa';
column name sex age height weight;
by sex;
footnote 'Measurements are in metric tons.';
run;
proc report data=class nowindows contents='table2: bbbbbb';
column name sex age height weight;
by sex;
footnote 'Measurements are in metric tons.';
run;
ods rtf close;
Hi:
That extra "Table 1" node is something that PROC REPORT introduces. To get rid of that, you have to use a technique from this Tech Support note: http://support.sas.com/kb/31/278.html.
To do without the BY groups, you'd have to actually NOT use the BY statement. You could move to using PAGE instead of BY with PROC REPORT. But that means one of your variables (most likely SEX) for this scenario has to be a GROUP or ORDER variable.
Also, ODS PROCLABEL will get rid of the "top" node in the table of contents.
Here's something I mocked up -- program and output shown below.
cynthia
When you open the figure attached. You can see 'Table 1' index , I do not want the "Table 1".
I only want to keep The index of "Table 1: aaaaaaaaaaaa" and 'Table 2: bbbbbbbbbbbbbbbbbbbbbbb'.
If you have a method to control the display of "F bygroup" and suppress the 'M bygroup' it will be great.
Hi:
That extra "Table 1" node is something that PROC REPORT introduces. To get rid of that, you have to use a technique from this Tech Support note: http://support.sas.com/kb/31/278.html.
To do without the BY groups, you'd have to actually NOT use the BY statement. You could move to using PAGE instead of BY with PROC REPORT. But that means one of your variables (most likely SEX) for this scenario has to be a GROUP or ORDER variable.
Also, ODS PROCLABEL will get rid of the "top" node in the table of contents.
Here's something I mocked up -- program and output shown below.
cynthia
Thanks a lot.
I can not open the link ' http://support.sas.com/kb/31/278.html. ' Can you please send me the file?
If I include a figure inside like below. How can I remove the marked part "The SGPlot Procedure"
?
ods rtf file='XXXX\try.rtf' contents=yes toc_data bodytitle;
options nobyline;
data class; set sashelp.class; dummy_c=1; run;
ODS PROCLABEL="Table: class_table";
proc report data=class nowindows contents='';
column dummy_c name sex age height weight;
define dummy_c /group noprint;
break before dummy_c /page contents=' ';
footnote 'Measurements are in metric tons.';
run;
ods graphics on;
ODS PROCLABEL="Figure: class_figure";
proc sgplot data=class;
scatter x=height y=weight / group=sex;
run;
ods rtf close;
Use the DESCRIPTION= option on the PROC SGPLOT statement.
ods rtf file='XXXX\try.rtf' contents=yes toc_data bodytitle;
options nobyline;
data class;
set sashelp.class;
dummy_c=1;
run;
ODS PROCLABEL="Table: class_table";
proc report data=class nowindows contents='';
column dummy_c name sex age height weight;
define dummy_c /group noprint;
break before dummy_c /page contents=' ';
footnote 'Measurements are in metric tons.';
run;
ods graphics on;
ODS PROCLABEL="Figure: class_figure";
proc sgplot data=class description='';
scatter x=height y=weight / group=sex;
run;
ods rtf close;
Great Thanks
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.