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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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