BookmarkSubscribeRSS Feed
deleted_user
Not applicable
i had an issue with the title statement.

in a ODS output i have


ods pdf file=" html file";

title1"report title";

Proc report data=drugA ;
run;


title2 "print title";

proc print data =DrugB;
run;

ods _all_ close;


but in the output i am getting both the titles on the top of the report only....i want title1 to be at the top of report and title2 to be on top of print output.

is there any other way to get the output witht the titles in the required location.

thanks
Sid
3 REPLIES 3
ArtC
Rhodochrosite | Level 12
If both titles are showing on the first step, check that there is a RUN; between the REPORT step and the second title definition.

If you want the second title to replace the first, be sure to use TITLE1 not TITLE2.

Double check the ODS destinations to make sure that you are not mixing the destination and the file extension.

The following will show only the first title for the REPORT step and both for the PRINT.
[pre]ods html file="c:\temp\twotitl.html";
ods pdf file="c:\temp\twotitl.pdf";

title1 "report title";
Proc report data=sashelp.class nowd;
run;

title2 "print title";
proc print data =sashelp.class;
run;
ods _all_ close;
deleted_user
Not applicable
Thanks for the reply
i am using ods pdf startpage=no option in between...so that i will get both the report output and print output in the same page....if i dont use that as u said i am getting them with titles in different pages.Sorry for the confusion


Thanks
Sid
ArtC
Rhodochrosite | Level 12
With startpage=no the second title1 statement will not appear until the second physical page. If for instance the second proc spills onto a second page - as below.

Consider using the ODS PDF TEXT= option.
[pre]*ods html file="c:\temp\twotitl.html";
ods pdf file="c:\temp\twotitl.pdf";
ods pdf text='abc';
title1 "report title";
Proc report data=sashelp.class nowd;
run;
ods pdf startpage = no;
ods pdf text='def';
title1 "print title";
proc print data =sashelp.class;
run;
ods _all_ close;[/pre]

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1226 views
  • 0 likes
  • 2 in conversation