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
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;
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;
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?
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.