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