How to get rid of superfluous titles while using ODS bodytitle?

Reply
New Contributor
Posts: 3

How to get rid of superfluous titles while using ODS bodytitle?

Hello,

In the following code I want to create a rtf file with several tables. I have to call a procedure in the middle of the outputs that is supposed to not create any output but only a dataset for later use. However, when I use the option BODYTITLE in the ODS statement I get an additional title from the PROC UNIVARIATE but no content (see the "My Title" below the first table on the first page). Deleting the BODYTITLE solves the problem and the title disappears. But I would like to have the title in the document... I already tried several other ways (e.g. NOPRINT in the PROC UNIVARIATE instead of ODS SELECT NONE) but I wasn't able to delete the superfluous title. Any ideas or suggestions?

Best regards

Martin

PS: I use SAS 9.3 on Windows

ods rtf file="c:\tmp\test.rtf" bodytitle ;

title "My title";

/*First output*/

proc freq data=sashelp.class;

    table sex;

run;

/*This is to create a dataset for later use (not shown here)*/

ods select none;

proc univariate data=sashelp.class ;

    var age;

    output out=stats mean=mean;

run;

ods select all;

/*Second output*/

proc freq data=sashelp.class;

    table sex;

run;

ods rtf close;

Super Contributor
Posts: 349

Re: How to get rid of superfluous titles while using ODS bodytitle?

Posted in reply to MartinKappler

Hi,

Is this what you are looking for.

ods rtf file="c:\tmp\test.rtf" bodytitle ;

title "My title";

/*First output*/

proc freq data=sashelp.class;

    table sex;

run;

title ;

/*This is to create a dataset for later use (not shown here)*/

ods select none;

proc univariate data=sashelp.class ;

    var age;

    output out=stats mean=mean;

run;

ods select all;

/*Second output*/

proc freq data=sashelp.class;

    table sex;

run;

ods rtf close;

Thanks,

Shiva

New Contributor
Posts: 3

Re: How to get rid of superfluous titles while using ODS bodytitle?

I thought about this too. The problem is that all runs within a macro and I don't want to delete the title just for this procedure and to set it again later. It's feasible but I think there should be another solution...

Best regards

Martin

Super User
Posts: 11,343

Re: How to get rid of superfluous titles while using ODS bodytitle?

Posted in reply to MartinKappler

I generally try to create all datasets outside of ODS output because quite often I end up working with output appearance options and there is not reason to keep recreating datasets I am going to display with FREQ, TABULATE or other report or graphical procedures.

Have you tried the NOPRINT options on your PROC UNIVARIATE call?

Or try another procedure such as SUMMARY which generates most of the same statistics as univariate but doesn't produce "print" output by default.

SAS Super FREQ
Posts: 8,868

Re: How to get rid of superfluous titles while using ODS bodytitle?

And, the statement:

ODS NOPTITLE;

or

ODS NOPROCTITLE;

will turn off the automatic procedure titles, if you prefer to leave your entire program within the ODS "sandwich" -- but I follow ballardw's method of working, too. If I need to create an output dataset, I usually do all the data manipulation outside of my ODS "sandwich", so that the only things being sent to ODS explicitly are the procedures within the 2 ODS statements.

cynthia

New Contributor
Posts: 3

Re: How to get rid of superfluous titles while using ODS bodytitle?

Posted in reply to Cynthia_sas

Thanks ballardw and Cynthia.

Yes, I tried NOPRINT. But this does not change anything.

Wrt NOPROCTITLE, this deletes the procedure titles and not the title from the TITLE statement. Thus, it doesn't work either.

And I agree, separating the dataset creation from the output creation would be a solution. But the example is much more simplistic than my real problem. Each output comes from a macro and I can't put the dataset creation before the first output. Hmmm, I will contact the tech support and will post the solution (if there's one).

Best regards

Martin

Ask a Question
Discussion stats
  • 5 replies
  • 502 views
  • 0 likes
  • 4 in conversation