BookmarkSubscribeRSS Feed
niyshah
SAS Employee
When I execute the below code, it gives me the required output in pdf, however I get some unwanted bookmarks like “FilePrint”.
Is there any way, I can get rid of these additional bookmarks?

Any help is appreciated.

--Thanks

ods escapechar="~";

proc template;
define table foo;
column text ;
style={frame=void};
define text;
print_headers = off;
end;run;


title ;



ods pdf file="C:\pngconvert.pdf" bookmarklist=show bookmarkgen=yes;

ods proclabel = "Test";
%let text=~{style [just=c font_weight=bold font_size=14pt] Test };
/**/
data _null_ ;
file print ods =(template="foo");
description="";
length text $100;
text = "&text";
put _ods_;
run;

ods pdf close;
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
ODS creates a "node" or label for every major creation point of a document. So when the DATA step starts, you get a node for the beginning of the data step program -- that is the node label that gets changed by the ODS PROCLABEL statement.

The next major creation point is when the template gets called and bound to some data. Without any other instruction from you, that node is labelled FilePrint, FilePrint2, FilePrint3, etc. You can change or eliminate the name on that node in the SAS Results Window and in the PDF TOC as shown below. Note that the PDF TOC will not show the second level node at all, while the SAS Results Window will still show the object, but with the object name. This is not a big deal, because the node in the PDF TOC is gone and the ODS PROCLABEL text is what appears.

cynthia
[pre]
ods escapechar="~";
ods path work.tmp(update) sasuser.templat(update) sashelp.tmplmst(read);
proc template;
define table foo;
column text ;
style={frame=void};
define text;
print_headers = off;
end;
end;
run;

title ;

ods listing close;
ods pdf file="C:\temp\pngconvert4.pdf" bookmarklist=show bookmarkgen=yes;

ods proclabel = "Test";
%let text=~{style [just=c font_weight=bold font_size=14pt] Twas brillig and the slithy toves };
/**/
data _null_ ;
file print ods =(template="foo"
object=wombat
objectlabel="ObjectLabel");
description="";
length text $200;
text = "&text";
put _ods_;
run;

ods proclabel = 'The Second Output';
%let text=~{style [just=c font_weight=bold font_size=14pt] Did gyre and gimble in the wabe };
/**/
data _null_ ;
file print ods =(template="foo"
object=koala
objectlabel=" "); /* quote space quote */
description="";
length text $200;
text = "&text";
put _ods_;
run;

ods pdf close;

[/pre]
niyshah
SAS Employee
Thanks, it worked out.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1372 views
  • 0 likes
  • 2 in conversation