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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2322 views
  • 0 likes
  • 2 in conversation