BookmarkSubscribeRSS Feed
Prakash_sas
Calcite | Level 5


Hi all,

I am generating two reports(two procedures used)  in a single page by using ods pdf as per requirement.

The reports are generated one by one in single page, but the title is coming only for first report not for second report.

sample code:

ods pdf file="/drive1/Sample_Reports.pdf"  startpage=never ;

ods proclabel = "Sample Report 1" ;

title 'REPORT - 1 ';

proc print data=sashelp.class  noobs contents = "" ;
where age =15;

run;

ods proclabel = "Sample Report 2" ;

title 'Report - 2';

proc print data= sashelp.class noobs contents = "";
where SEX = 'F';

run;

ods pdf close;

I got the report in a single pdf page, but the report is having a only title i.e.,  REPORT - 1 

I need second title ('Report - 2')  to be printed after end of  first report and before start of second report as mentioned in code.

Could some one help me .?

Thanks,

Prakash

1 REPLY 1
Reeza
Super User

Titles are printed at the top of pages, you can use ODS PDF TEXT="" instead of titles if you have multiple reports on one page:

Think of the titles as headers instead of titles in this case.

ods pdf file="/drive1/Sample_Reports.pdf"  startpage=never ;

ods proclabel = "Sample Report 1" ;

ods pdf text= 'REPORT - 1 ';

proc print data=sashelp.class  noobs contents = "" ;
where age =15;

run;

ods proclabel = "Sample Report 2" ;

ods pdf text= 'Report - 2';

proc print data= sashelp.class noobs contents = "";
where SEX = 'F';

run;

ods pdf close;

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
  • 1 reply
  • 2248 views
  • 0 likes
  • 2 in conversation