ods rtf file="C:\Users\user\Desktop\test.rtf";
data t;
a='';
run;
proc report data=t
style={protectspecialchars=off
frame=void rules=none font_size=10.5 fontweight=bold posttext = "\outlinelevel3\ {title1:this is a test} \par"};
column a;
define a/noprint;
run;
ods rtf close;
I tried to generate a report automaticly by ODS RTF statement and to control the outlinelevel of the text"title1:this is a test".
But nothing was output when I ran this code.
I just found this code works only if remove the 'noprint' option.But this will cause the output of the data that i dont want.
Pls help on this,Many thanks.
Hi:
I don't understand your code. NOPRINT is used in PROC REPORT to suppress the visibility of a column. Since A was just a space, I don't understand the purpose of the variable. It seems that you wanted to have some kind of string "this is a test" defined in RTF control strings as outlinelevel3 -- I don't understand what that would LOOK like in the RTF file. But since you were hanging the posttext onto an unknown part of PROC REPORT (did you mean to have style(report) there?) once you suppress A, there's no report for PROC REPORT to display. And, POSTTEXT would put the text at the BOTTOM of the report, or AFTER any text in a report cell, is that what you want? Also, if all you want to do is suppress the headers, there is a NOHEADER option for PROC REPORT that will work. If you are trying to insert items into your own TOC with OUTLINELEVEL3, this may be relevant: http://www2.sas.com/proceedings/forum2007/097-2007.pdf and http://support.sas.com/resources/papers/proceedings11/116-2011.pdf and http://www2.sas.com/proceedings/forum2008/238-2008.pdf .
There are other ways to write text, but without knowing what this would look like or what outlinelevel3 does, it is hard to speculate.
Cynthia
Hi Cynthia, Thanks for your reply and papers.
You right,a (report) in style statement was missed.
Please refer to the image below,I want to keep the text"title1: this is a text" which highlighted ,and remove the variable named x .But the"define(x)/noprint" option didnt work at all.Do you know any other ways to set outlinelevel?
ods rtf file="C:\Users\user\Desktop\test.rtf";
data t;
x=" ";
run;
proc report data=t
style(report)={protectspecialchars=off
frame=void rules=none font_size=10.5 fontweight=bold posttext = "\outlinelevel3\ {title1:this is a test} \par"};
run;
column x;
define x/center;
ods rtf close;
Hi Cynthia,look at this
Hi Cynthia,
"NOHEADER" option is a good choice.That's what I want.
Thanks a lot!
Marakesh
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.