The SAS Output Delivery System and reporting techniques

Ods rtf Title

Reply
New Contributor
Posts: 2

Ods rtf Title

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.

 

 

 

 

Super User
Posts: 20,671

Re: Ods rtf Title

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

 

 

New Contributor
Posts: 2

Re: Ods rtf Title

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

SAS Super FREQ
Posts: 8,949

Re: Ods rtf Title

[ Edited ]

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;

Ask a Question
Discussion stats
  • 3 replies
  • 172 views
  • 0 likes
  • 3 in conversation