BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Barkat
Pyrite | Level 9

I have 2 graphs (Fig-1, and -2), and 3 tables (table-1, -2, and -3) in a SAS program. I would like to keep fig-1, and -2 with their titles in page-1, table-1 in page-2, and table-2, and -3 with their titles in page-3 of a pdf output file. 

When I run the following code, the titles of the last figure/table do not display when multiple figures/tables are in a same page (e.g. fig-1, and -2 remain in the same page but title of fig-2 does not appear). I am not sure how to fix.

 

ods _all_ close;

ods pdf file="\\xxxxx/xx/xxxx abc.pdf"
notoc startpage=no NOGTITLE NOGFOOTNOTE ;
ODS Graphics / reset=all width=8in height=4in scale=on border=off imagefmt=png;
options nodate number ;

footnote1 height=7pt justify=left "xxxxxxxxx xxxxxxxxx xxxxxxxx as of &SYSDATE";
footnote2 height=8pt justify=right "&SYSDATE";


title height=10pt "Figure 1. xxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxx";
proc sgplot data=casepop1 ;
series x=Countyear y=SP /datalabel=SP lineattrs=( thickness=3 pattern=shortdash ) markers legendlabel="SP" ;
series x=Countyear y=VSP /datalabel=VSP lineattrs=( thickness=3 pattern=longdash) markers legendlabel="VSP";
format SP VSP ;
yaxis label='Cases per 100,000' LABELATTRS=(Family=Arial Size=10 Style=Italic Weight=Bold)
valueattrs=(Family=Arial color=gray size=10pt);
xaxis valueattrs=(Family=Arial color=gray size=10pt) values=(2007 to 2021 by 1) display= (nolabel) NOTIMESPLIT VALUESROTATE= VERTICAL;
run;


title height=10pt "Figure 2. xxxxxxxxxxx xxxxxxxxxxxxx xxxxxxxxxxx";
proc sgplot data=casepop1;
series x=Countyear y=OthEnd / datalabel=OthEnd lineattrs=( color=red thickness=3 pattern=shortdash) markers legendlabel="Other Endemic Institutions";
series x=Countyear y=California / datalabel=California lineattrs=(color=seagreen thickness=3 pattern=longdash) markers legendlabel="California";
format OthEnd California;
yaxis label='Cases per 100,000' LABELATTRS=(Family=Arial Size=10 Style=Italic Weight=Bold)
valueattrs=(Family=Arial color=gray size=10pt);
xaxis values=(2007 to 2021 by 1) display= (nolabel) NOTIMESPLIT VALUESROTATE= VERTICAL valueattrs=(Family=Arial color=gray size=10pt);
run;


title height=10pt "Table 1. xxxxxxxxxxxx xxxxxxxxxxxxx xxxxxxxxxxxx";
proc report data=casepop2;
column CountYear Person vsp sp vspsp OthEnd NonEnd chcs Kern California;
run;


title height=10pt "Table 2. xxxxxxxxxxxxx xxxxxxxxxxxxx xxxxxxxx";
proc report data=casepop3;
column Institution Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ;
run;


title height=10pt "Table 3. xxxxxxxxxxx xxxxxxxxxxx xxxxxxxxx";
proc report data=casepop4;
column Institution Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ;
run;
title;
footnote;

ods pdf close;

1 ACCEPTED SOLUTION

Accepted Solutions
svh
Lapis Lazuli | Level 10 svh
Lapis Lazuli | Level 10
This is a common issue I think many of have faced when using ODS PDF as an output destination. See this answer to an earlier post that suggests how to use ODS TEXT=. It seems that once we introduce STARTPAGE= into the code, we interfere with how titles are produced and need to rely on ODS TEXT=

https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-Titles/m-p/114009#M10146

View solution in original post

1 REPLY 1
svh
Lapis Lazuli | Level 10 svh
Lapis Lazuli | Level 10
This is a common issue I think many of have faced when using ODS PDF as an output destination. See this answer to an earlier post that suggests how to use ODS TEXT=. It seems that once we introduce STARTPAGE= into the code, we interfere with how titles are produced and need to rely on ODS TEXT=

https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-Titles/m-p/114009#M10146

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
  • 1 reply
  • 1280 views
  • 1 like
  • 2 in conversation