BookmarkSubscribeRSS Feed
Marakesh
Calcite | Level 5
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.

6 REPLIES 6
Cynthia_sas
SAS Super FREQ

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

Marakesh
Calcite | Level 5

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?

无标题.png

Cynthia_sas
SAS Super FREQ
Hi: I'm stumped -- you must not have sent all your code because I don't see anything in your posted code that refers to X in dataset WORK.T.

Sorry,

Cynthia
Marakesh
Calcite | Level 5
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

 

Cynthia_sas
SAS Super FREQ
Hi:
You should have the RUN immediately before your ODS RTF CLOSE; -- NOT before your COLUMN statement. Is this program producing any output for you? It is probably producing all the defaults, but you should also be seeing error messages in the log. In my posting on Friday, I suggested you look in the documentation for the NOHEADER option on the PROC REPORT statement. Did you do that? I believe that would help you here once you correct your other mistakes.

Cynthia
Marakesh
Calcite | Level 5

Hi Cynthia,

 

"NOHEADER" option is a good choice.That's what I want.

 

Thanks a lot!

Marakesh

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1498 views
  • 0 likes
  • 2 in conversation