BookmarkSubscribeRSS Feed
DevUser
Calcite | Level 5

Hello,

 

I am using  title statement with ods rtf in my program to make graphs with proc sgplot and sgpanel.

 

ods  rtf file="mypath" notoc_data nogtitle nogfootnote;

title height=4 color=black bold  "&title"  height =1 j=c justify=right  j=left  "%sysfunc(data(),mmddyy10.)";

 

 

Proc sgplot data=mydata ........

 

i have many pages in my output with the same title wich is normal.

Can you tell me if there is an option or statement to have "&title" for the first page with graphics  and "Figure&title" for the other ones after the first break ?

 

Thank you for your help.

 

 

 

 

3 REPLIES 3
Reeza
Super User

You can have multiple titles and text. You can use ODS TEXT or PROC ODSTEXT to create your text/title. 

 

 

DevUser
Calcite | Level 5

Hello,

 

Thank you for your help, but i can't define multiple title because all graphics are generated by the same sgplot statement.

i'm looking about an option to put in my ods rtf in order to have "&title" as a title of the first page and "Figure&title" for  the other pages after breaking.

 

Best Regards

Cynthia_sas
Diamond | Level 26

Hi:
You can only use a TITLE statement or ODS TEXT between steps. If you want a different title on the first page, then you'll need to have 1 PROC step for the first page and have a different title for the second and subsequent pages, as shown below.

Cynthia

diff_title_page2.png

 

Here's the code (I cleaned up your TITLE statement -- you had too many justify options and I prefer to specify the font in PT size for RTF):

** create different title macro variables;
%let title=Wombat for Page 1;
%let figuretitle=Koala for Other pages;

** only use 4 regions;
proc sort data=sashelp.shoes out=shoes;
by region product;
where region in ('Asia', 'Canada', 'Eastern Europe', 'Western Europe');
run;

options nodate nonumber orientation=portrait 
        rightmargin=.5in leftmargin=.5in;
		  
ods rtf file='c:\temp\mult_title.rtf' nogtitle nogfootnote;
** for page 1;
title height=14pt color=black bold  j=c "&title"   
      height=10pt j=right  "%sysfunc(date(),mmddyy10.)";

proc sgplot data=shoes;
  where region = 'Asia';
  by region;
  vbar product / response=sales group=product;
run;
  
** for other pages;
title height=14pt color=black bold j=c  "&figuretitle"  
      height=10pt j=right   "%sysfunc(date(),mmddyy10.)";
  
proc sgplot data=shoes;
  where region ne 'Asia';
  by region;
  vbar product / response=sales group=product;
run;
ods rtf close;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 2262 views
  • 0 likes
  • 3 in conversation