The SAS Output Delivery System and reporting techniques

Creating headers for each proc print using ODS RTF

Reply
Contributor
Posts: 29

Creating headers for each proc print using ODS RTF

Hi

I am using ODS RTF BOOKMARK to create bookmark's in RTF report. I have 10 different datasets and using proc print to output the data in RTF . SInce i am not  creating any header for each proc print , i am unable to get the bookmark. Getting a message after opening the RTF as "This document does not contain headings", hence  the headers are not displayed  on the bookmark.Could any one please suggest how to create headers for each proc print using ods rtf .

Here is the sample code .

ods rtf file="D:\&path._chk..rtf" style=custom title="Bookmarking" ;

title1 j=l h=10pt ' Sample Data check     ;

ods rtf startpage=no;

ods rtf text='Header One ';

ods rtf bookmark='Header one ';

proc print data=_end_ label noobs  style(table)=[just=left] contents='' width=minimum;

  var one two three four five ;

run;

ods rtf startpage=no;

ods rtf text='Header two';

ods rtf bookmark='Header Two ';

proc print data = two noobs label noobs  style(table)=[just=left] contents='' width=minimum;

var four five six seven eight;

run ;

...............similary for 10+ proc print for different data

Ods rtf close .

Any possible methods to create headers to get  the bookmarks.

Thanks in advance for  your help.

Grand Advisor
Posts: 10,210

Re: Creating headers for each proc print using ODS RTF

The default behavior from your posted code should have a title in the header of each print.

HOWEVER you have a custom style referenced STYLE=CUSTOM.

Try with the default style and see if you get the behavior you need. If so, then your custom style has done something with the header entries.

SAS Super FREQ
Posts: 8,718

Re: Creating headers for each proc print using ODS RTF

Hi:

When I test code similar to yours, I get this error because you have spaces in the text string:

ERROR: The anchor value "Header one " is not valid for the

       "RTF" destination; anchors cannot contain white space,

       control characters, or any of the following:

       "()<>[]{}/%&\". Anchor value will be ignored.

Also, are you going to generate a contents page or not? You don't have TOC_DATA turned on as an option. I don't understand how your code is working at all. You should get an error message on the space for BOOKMARK=.

cynthia

Ask a Question
Discussion stats
  • 2 replies
  • 494 views
  • 0 likes
  • 3 in conversation