The SAS Output Delivery System and reporting techniques

proc report: suppress title repeating for each by group

Reply
Regular Contributor
Posts: 187

proc report: suppress title repeating for each by group

Hi,

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

-Bart
SAS Employee
Posts: 174

Re: proc report: suppress title repeating for each by group

Posted in reply to bheinsius
Bart,

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

-- David Kelley, SAS
Regular Contributor
Posts: 187

Re: proc report: suppress title repeating for each by group

Posted in reply to David_SAS
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
SAS Employee
Posts: 174

Re: proc report: suppress title repeating for each by group

Posted in reply to bheinsius
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
Regular Contributor
Posts: 187

Re: proc report: suppress title repeating for each by group

Posted in reply to David_SAS
Hi David,

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

-Bart
SAS Employee
Posts: 174

Re: proc report: suppress title repeating for each by group

Posted in reply to bheinsius
Bart,

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

-- David Kelley, SAS
Regular Contributor
Posts: 187

Re: proc report: suppress title repeating for each by group

Posted in reply to David_SAS
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
Ask a Question
Discussion stats
  • 6 replies
  • 816 views
  • 0 likes
  • 2 in conversation