10-30-2017 12:59 PM
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.
10-31-2017 05:05 AM
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.
10-31-2017 10:34 AM - edited 10-31-2017 10:36 AM
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.
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;