BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sammy2
Calcite | Level 5

Hi,

 

I am not able to print titles to second proc print in same pdf. In the Result Viewer they are but not in the pdf?!?!

 

I used this code:

 

 

data first1;
      input patient num1 num2;
cards ;
1     22    33
1     33    44
2     55    66
run;
 
ods pdf file="C:\Temp\Patient1and2.pdf" startpage=no notoc ;
 
title1 "Title 1";
title2 "Title 2";
 
proc print data=first1 noobs label;
      where patient = 1;
      var patient num1 num2;
run;
 
title1 "Title 1 modified";
title2 "Title 2 modified";
 
proc print data=first1 noobs label;
      where patient = 2;
      var patient num1 num2;
run;
 
ods pdf close;

 

Any idea why titles (both original and modified) are left out from pdf?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tim_SAS
Barite | Level 11

Titles are associated with the top of the page. If you want to insert text between 2 tables on the same page, use the ODS TEXT statement.

View solution in original post

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

As far as I knw=ow, and can't check this, you can only have one set of titles/footnotes per page.  You could try putting the two outputs on separate pages, using ods text= to display other text before the second output.  The reason being is that text above the second output isn't cosidereda title - which can only be at the top of the page.  For your given example, you may find it better to do something like:

ods pdf file=...

proc report data=first1 nowd;
  columns...;
  by patient;
  title "Patient: #byvar1";
  title2 "Abc";
  define...;
run;

ods pdf close;
Tim_SAS
Barite | Level 11

Titles are associated with the top of the page. If you want to insert text between 2 tables on the same page, use the ODS TEXT statement.

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore 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
  • 6348 views
  • 2 likes
  • 3 in conversation