BookmarkSubscribeRSS Feed
bheinsius
Lapis Lazuli | Level 10
Hi,

Is there a way to suppress the title specified on the TITLE statement from repeating for every BY group in PROC REPORT?

-Bart
6 REPLIES 6
David_SAS
SAS Employee
Bart,

You could try replacing the TITLE statement with and ODS TEXT= statement.

-- David Kelley, SAS
bheinsius
Lapis Lazuli | Level 10
Hi David,

Thanks for your answer.

Using ODS TEXT= generates an error message:

ERROR 180-322: Statement is not valid or it is used out of proper order.

Is ods text sas92 only?

-Bart
David_SAS
SAS Employee
Bart,

ODS TEXT= is new to SAS 9.2:

http://support.sas.com/rnd/base/new92/92odsmore.html#odstext

SAS 9.1 has destination-specific TEXT=, e.g.:

ods pdf file="out.pdf" text="Hello World!';
ods html file="out.html" text="Hello World!";

-- David Kelley, SAS
bheinsius
Lapis Lazuli | Level 10
Hi David,

My program runs as a stored process, I think that ods html statements won't work there.

-Bart
David_SAS
SAS Employee
Bart,

I recommend contacting Technical Support. To do that, click "Contact Us" at the bottom of the forum web page.

-- David Kelley, SAS
bheinsius
Lapis Lazuli | Level 10
Hi,

I tracked the problem with Techsupp, they came up with the following solution, which works perfectly:

[PRE]

proc sort data=sashelp.class out=sorted;
by age;
run;

%put &_ODSDEST;
data _null_;
if "&_ODSDEST" eq "HTML" then
Ods html Text="Test Bart- EOM";
if "&_ODSDEST" eq "PDF" then
Ods PDF Text="Test Bart- EOM";
run;

proc report data=sorted nowindows;
column name sex weight;
by age;
define name / display;
define sex / display;
define weight / display;
run;

[/PRE]

Replacing:
[PRE]

Text="Test Bart- EOM"

[/PRE]
with:
[PRE]

Text="<span class=""c SystemTitle"">Test Bart- EOM</span>"

[/PRE]
preserves the title style.

- Bart

Added PRE tages around SAS code Message was edited by: bheinsius

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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