The SAS Output Delivery System and reporting techniques

Adding text before output

Reply
N/A
Posts: 0

Adding text before output

Is it possible to modify the an ODS style sheet in a way in order to add text before each table created by a procedure?

For example, add the text "XXXX" before each table created by a PROC REPORT output?

I have tried using the PRETEXT="XXXX" statement, however this also adds the text in to every cell the the tables along with before each table.

Any help would be very much appreciated.
Super Contributor
Posts: 394

Re: Adding text before output

Can you say more about what you're looking for here? In what way is this text different from a plain title? Where part of the table do you want the text associated with? Do you want the text to appear only at the start of the entire report, or at the start of each by-group?
N/A
Posts: 0

Re: Adding text before output

I have (embarrassingly) found a work-around using a number of ODS RTF SELECT statements, which seems to give me what I'm after.
N/A
Posts: 0

Re: Adding text before output

> Can you say more about what you're looking for here?
> In what way is this text different from a plain
> title? Where part of the table do you want the text
> associated with? Do you want the text to appear only
> at the start of the entire report, or at the start of
> each by-group?

I have a similar problem. I was trying to use PRETEXT= because I'm using the BODYTITLE option (I need my titles & footnotes external to the header & footer in my RTF). I've tried multiple ways after reading different papers from SUGIs/Global Forums. I'm looking for help: what is the best method to put titles & footnotes on each page when BODYTITLE is in effect?
SAS Super FREQ
Posts: 8,745

Re: Adding text before output

Just in case your method doesn't work under some circumstance, you should also check out the TEXT= ODS option. It works like this:
[pre]
ods html file='somefile.html';


ods html text='before proc 1';

...sas code for proc 1 ...


ods html text='before proc 2';

... sas code for proc 2 ...
ods html close;
[/pre]
If you were creating PDF or RTF, then all the references to HTML in the above sample would change accordingly. Remember also that other statements like your title, footnote and by lines will also have an effect on the output. Still, ODS TEXT= is a handy tool for adding extra captions or explanatory text before or after your procedure output.
cynthia
N/A
Posts: 0

Re: Adding text before output

I have a similar problem. I was trying to use PRETEXT= because I'm using the BODYTITLE option (I need my titles & footnotes external to the header & footer in my RTF). I've tried multiple ways after reading different papers from SUGIs/Global Forums. I'm looking for help: what is the best method to put titles & footnotes on each page when BODYTITLE is in effect?
Super Contributor
Super Contributor
Posts: 3,174

Re: Adding text before output

Suggestion: A more effective technique to post to the forum is to start a new thread (instead of piggy-backing on a 3 year old thread from someone else), and if you must then include a link to the prior thread for reference.

Scott Barry
SBBWorks, Inc.
SAS Super FREQ
Posts: 8,745

Re: Adding text before output

Hi:
I agree with Tim, that we need a bit more info. TITLEs can be left justified, or center justified, so they might do the trick.

You might also look at some COMPUTE BEFORE examples -inside- PROC REPORT....or some ODS TEXT= examples (which would go -outside- of PROC REPORT). I generally do not use PRETEXT=/PREHTML=, except occasionally to pass RTF control strings into RTF or HTML files created with ODS.

Also relevant is your destination of choice -- LISTING, HTML, RTF, etc.

cynthia
Ask a Question
Discussion stats
  • 7 replies
  • 299 views
  • 0 likes
  • 4 in conversation