BookmarkSubscribeRSS Feed
erikhendrickson
Calcite | Level 5

My PDF code copies my graph titles from the previous page onto the next page's margin header. I would like to not have that happen, by retaining the graph title and does not duplicate it on the next page's margin header.

 

Thanks!

 

Abbreviated Code Below:

 

ODS noproctitle; 

options NOQUOTELENMAX;

ODS _all_ close;

ods listing close;

options papersize=A4 nodate;

options orientation=landscape leftmargin="1.5cm" rightmargin="1.5cm" topmargin="1.5cm" bottommargin="1.5cm"; 

goptions ftext="helvetica/bold" noborder device=CGMOF97P NOGRAPHRC;

ods pdf file="C:\Exports\FILENAME.pdf" notoc startpage=no style=Printer;

ods graphics / height=6in;

ods escapechar ="~";

ods layout start;

ods region y=0in;

ods text="~{style [color=blue just=left font_size=16pt]Summary Report}";

ods region y=0in x=3in;

ods text="~{style [color=blue just=right font_size=12pt]Report date: %sysfunc(today(),mmddyy10.)}";

ods layout end;

 



ods pdf startpage=now; 

ods layout start;

data tableview/view=tableview;

set merged_overall nobs=__nobs;

if _n_ gt __nobs-14;

run;

ods region y=0in;

ods text="~{style [just=center font_size=14pt color=black]Table 1}";

ods region y=1in;

proc print data=tableview noobs label; 

var admitdt1 Variable 2;

run;

ods layout end;

 

ods startpage=now; 

ods layout start;

ods region y=0in;

ods pdf text="~{style [just=center font_size=20pt color=black]OVERALL}";

ods region y=0.5in;

proc sgplot data=merged_overall (where=(&period));

title1 "Overall Trends";

title2 "Trendlines & 7-day Moving Averages";

series y=MovAv x=admitdt1 / legendlabel="Encounters" lineattrs=(color=blue pattern=solid thickness=2);

run;

ods layout end;

 

ods startpage=now; 

ods layout start;

ods region y=0in;

ods pdf text="~{style [just=center font_size=20pt color=black]ENCOUNTERS}";

ods region y=0.5in;

proc sgplot data=merged_gender (where=(&period)) dattrmap=attrmap;

title1 "Encounters by Gender";

title2 "Trendlines & 7-day Moving Averages";

yaxis label="Number of Encounters";

series y=MovAv x=admitdt1 / group=gender attrid=gender lineattrs=(pattern=solid thickness=2);

xaxis tickvalueformat=mmddyy8.;

run;

ods layout end;

 

footnote ' ';

footnote2 height=11pt justify=left color=RoyalBlue "Note:";

run; title; footnote;

ODS pdf close;

ods listing;

 

 

 

 

2 REPLIES 2
ballardw
Super User

Assuming this plot is the offender :

proc sgplot data=merged_gender (where=(&period)) dattrmap=attrmap;
   title1 "Encounters by Gender";
   title2 "Trendlines & 7-day Moving Averages";
   yaxis label="Number of Encounters";
   series y=MovAv x=admitdt1 / group=gender attrid=gender lineattrs=(pattern=solid thickness=2);
   xaxis tickvalueformat=mmddyy8.;
run;
title;

I think you want the Title statement to clear the title inside the same layout block as the Proc using the title.

Ksharp
Super User
ods pdf file="C:\Exports\FILENAME.pdf" notoc startpage=no style=Printer nogtitle ;

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