BookmarkSubscribeRSS Feed
keen_sas
Quartz | Level 8

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.

2 REPLIES 2
ballardw
Super User

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.

Cynthia_sas
SAS Super FREQ

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

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