BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Nasser_DRMCP
Lapis Lazuli | Level 10

Hello,

 

I would like to put a text above a chart (generated by proc sgpplot) so I trythis code

ods rtf text = "^S={just=c } The Text ";

 

the problem I encounter is that the text in the output is the whole text between " " so ^S={just=c } The Text

and not only "The text"

Thanks in advance for your help

Nasser

1 ACCEPTED SOLUTION

Accepted Solutions
Nasser_DRMCP
Lapis Lazuli | Level 10

hello,

 

this is the solution below.

ods escapechar='^';

ods text ="^S={width=100% just=c } Go to SAS HomePage" ;

 

I forgot the green line code.But then It works

Nasser

View solution in original post

4 REPLIES 4
Reeza
Super User

Try the following:

ods rtf text = "The Text ";

or:

 

title j=c 'The Text';

You may need to modify the ODS RTF settings to get the title exactly where you want it, you can use the BODYTITLE option to include the TITLE in the body of the text, not the header.

 

If you're stilling having issues, I suggest you include some full code, with the SGPLOT and output included so we can clearly see what the issue is.

Nasser_DRMCP
Lapis Lazuli | Level 10
Title 'Amortissement'  ;



%macro Loop_Rac_ODS(count) ;
ODS RTF startpage = yes   FILE = "&filename." style = Sapphire NOGTITLE NOGFOOTNOTE BODYTITLE ;
%Do i=1 %To &count ;
	proc sql noprint ;
	select RAC_Label into :v_RAC_Label from RAC_Values where RAC_Indexe = &i ;
	quit ;
	
title j=c 'The Text';


	proc sgplot data = BEH_INDIC_7 (where=(RAC="&v_RAC_Label.")) ; 
 		series x = ANNEE_AMO_SUITE y = ratio / group = &v_AXE. lineattrs=(pattern=solid)  ;
  		xaxis display=(nolabel);
  		yaxis display=(nolabel);
  		KEYLEGEND / title = "" NOBORDER ;
	run;
%End ; 
ODS RTF CLOSE ;
%Mend Loop_Rac_ODS ;		


%Loop_Rac_ODS(3) ;

this is the whole code

 

I would like to keep the main title "Amortissement" in the header that 's why I mention "NOGTILE" but whenever I mention

title j=c 'The Text'; as you suggess, the main title is removed from the header

Reeza
Super User

BODYTITLE is what removes the title from the HEADER. 

 

Thanks for the code but I don't know what your issue is still. And I can't run it because we don't have data, so if you could simplify it to use a SASHELP dataset that may help.

Nasser_DRMCP
Lapis Lazuli | Level 10

hello,

 

this is the solution below.

ods escapechar='^';

ods text ="^S={width=100% just=c } Go to SAS HomePage" ;

 

I forgot the green line code.But then It works

Nasser

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
  • 4 replies
  • 4376 views
  • 0 likes
  • 2 in conversation