BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Niugg2010
Obsidian | Level 7

I have a PDF bookmark issue.

ods pdf file="text_1.pdf" ;
ods proclabel "This is an example";
Proc report data=sashelp.class contents= "" nowd;
Run;
ods pdf close;

the output is like below. My question is how to remove the yellow marked part quickly. I only want one level of bookmark. Thanks

 

Capture.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

What that link does to seem to spell out is that you cannot use the BREAK statement if you don't have any group variables.  And the trick of setting CONTENTS="" PAGE does not work to suppress that TOC entry when used on the RBREAK statement.

 

So you need to add a variable and define it as GROUP in the report.  Then you can use the BREAK statement.  You can use the NOPRINT option so the extra variable does not print.

ods pdf file="c:\downloads\text_1.pdf" ;
ods proclabel "This is an example";
data for_report; set sashelp.class;
 groupvar=1;
run;
proc report data=for_report contents= "" nowd;
 define groupvar / group noprint;
 break before groupvar / contents="" page;
run;
ods pdf close;

Tom_0-1679849284443.png

 

View solution in original post

4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
Review this Tech Support note: https://support.sas.com/kb/31/278.html and you'll see the code to remove this extra Table 1 node. This node is generated by PROC REPORT, so you need to use PROC REPORT to remove it.
Cynthia
Tom
Super User Tom
Super User

What that link does to seem to spell out is that you cannot use the BREAK statement if you don't have any group variables.  And the trick of setting CONTENTS="" PAGE does not work to suppress that TOC entry when used on the RBREAK statement.

 

So you need to add a variable and define it as GROUP in the report.  Then you can use the BREAK statement.  You can use the NOPRINT option so the extra variable does not print.

ods pdf file="c:\downloads\text_1.pdf" ;
ods proclabel "This is an example";
data for_report; set sashelp.class;
 groupvar=1;
run;
proc report data=for_report contents= "" nowd;
 define groupvar / group noprint;
 break before groupvar / contents="" page;
run;
ods pdf close;

Tom_0-1679849284443.png

 

Tom
Super User Tom
Super User

Side question:

 

Why does PROC REPORT treat CONTENTS=''  different than CONTENTS=' '?

 

In normal SAS syntax there is no difference as both imply a character string containing just on space character.

So what did they do different in the SAS parser to let PROC REPORT treat two quotes without anything between them as something different?

Niugg2010
Obsidian | Level 7

Correct. PROC REPORT treat CONTENTS=''  different than CONTENTS=' '. But where are no differences between "" and ''.

By the way, setting pdftoc=1 only influences the display when open PDF, and it will not remove level 2 and level 3 bookmark. 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 401 views
  • 0 likes
  • 3 in conversation