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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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