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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 4016 views
  • 0 likes
  • 2 in conversation