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
SAS Super FREQ

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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 1422 views
  • 0 likes
  • 3 in conversation