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.
You can have multiple titles and text. You can use ODS TEXT or PROC ODSTEXT to create your text/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
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
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;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.