BookmarkSubscribeRSS Feed
craig159753
Quartz | Level 8

Hi,

 

Firstly, I know there are several posts on here (and the SAS website - https://support.sas.com/kb/31/278.html) detailing how to suppress the second node within a bookmark but every suggestion is not working.

 

I have a simple PROC REPORT, which will create a 1 page PDF.

ods _all_ close;
ods pdf file="C:/Myfile.pdf" pdftoc=1;
ods proclabel="My Bookmark label";

  proc report data=sashelp.cars contents="";
    columns variable;
    break after variable / page contents="";
  run;

ods pdf close;
ods listing;

 

Even with the PDFTOC=1 option and both CONTENTS="" I still see a 2 level bookmark in the PDF, first level = "My Bookmark label" and the second level = "Table 1".

 

Oddly when I set to the CONTENTS="AA" on the PROC REPORT line, in the PDF, I still see a 2 level bookmark, however the second level now has two entries "Table 1" and "AA". Am I missing something here, where is this "Table 1" coming from. My code does use other procedures (PROC MEANS and PROC MIXED) but these are defined outside the ODS PDF lines so should no no effect.

 

Running the SAS EG 8.3 application with SAS 9.4 M7.

 

Any help is greatly appreciated.

5 REPLIES 5
Ksharp
Super User
ods pdf file="C:\temp\Myfile.pdf" style=journal;
ods proclabel="My Bookmark label";
data cars;
 set sashelp.cars;
 id=1;
run;
  proc report data=cars contents="";
    columns _all_;
	define id/group noprint;
    break before id / page contents="";
  run;

ods pdf close;

x.jpg

craig159753
Quartz | Level 8
Hi @Ksharp

Thanks for your message, however this did not work, I had previously tried this.

I believe I have a rogue procedure spitting out a second level somewhere
Cynthia_sas
SAS Super FREQ

Hi:
When I use the code that @Ksharp posted, using SAS 9.4 M7, I get the EXACT same results -- with just one level of bookmark. If you use the SAME code, the EXACT same code, and you do not get the SAME results in the PDF file, then you need to open a track with Tech Support. The code that @Ksharp posted does result in only 1 bookmark in the PDF file when using SAS 9.4 M7. Be sure that you are opening the file that's created with the ODS PDF statements and NOT the file that is automatically created by Enterprise Guide.
Cynthia

 

PS and, you would only have a "rogue" procedure if your code contains a "rogue" procedure -- meaning that if you only have 1 PROC REPORT, then you don't have a "rogue" procedure. The advantage of Tech Support is that they can look at ALL of you actual code and help you figure out what might need to be changed.

craig159753
Quartz | Level 8

Hi Cynthia.

 

The above code does produce a single level bookmark, it leads me to believe a separate PROC may be producing the second line in my bookmark labelled "Table 1". My code runs the following PROCs:

 

PROC MEANS (NOPRINT is specified)

PROC MIXED

PROC REPORT (with contents as defined in the example above)

 

Cynthia_sas
SAS Super FREQ

Hi:
Well, the code that @Ksharp posted only addressed your question about PROC REPORT. So now we've proved that PROC REPORT can be reduced to one Bookmark. The other procedures will probably generate bookmarks too. Since you didn't post all your code, the forum participants only addressed the question you asked about PROC REPORT. The way to isolate which "rogue" procedure is writing the output is to run a test with each procedure separately or with enough information to trace the procedure that is writing the extra links. You can prove that PROC REPORT isn't putting out the extra label. When I add PROC MEANS and PROC MIXED to the code I ran, I see what I expect for each procedure as shown below:

I don't know PROC MIXED, so I just used THIS documentation example https://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=statug&docsetTarget=st...  and the data that was there. I selected only the DIMENSIONS output object for the report because I wanted to show how each object is indented under the procedure's ODS PROCLABEL.

Cynthia_sas_0-1616431107991.png

 


Without ODS PROCLABEL before each procedure, you would see "The Means Procedure" or "The Mixed Procedure".
Hope this helps. If not, I would still recommend working with Tech Support on this.

Cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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