The SAS Output Delivery System and reporting techniques

ods pdf - table of contents

Reply
Frequent Contributor
Posts: 105

ods pdf - table of contents

Hey guys,

So I have a macro function that contains 4 calls to proc sgplot, and 1 proc tabulate. This macro is called 22 times to produce graphical/tabular output for 22 different products. Within the macro I have an ods pdf statement, so that all output is written to a single pdf file. I am wondering, if it is possible to suppress SAS from putting in the procedure names into the table of contents, but use my own custom labels. I have attempted this with proclabel, but haven't been able to completely exclude the procedure names, and get it set up how I really would like.

Ultimately, for each product, there will be 5 pages in the output file, 4 graphs from proc sgplot, and 1 table from proc tabulate; I would like there to be just one table of contents entry for each product. So for example setting the contents label at the top of the macro, so the table of contents label comes up "Product1" and then the pdf will contain the 5 pages of output for Product1, and then after the next macro call there will be the second label in the table of contents "Product2" and then all 5 pages for product2, etc..

- The best I have been able to get is a custom label for each procedure, but then the procedure name still comes up, such as:

+Product1

   -sgplot procedure

+Product1

   -sgplot procedure

+Product1

   -sgplot procedure

+Product1

   -sgplot procedure

+Product1

   -tabulate procedure

        -table1

+Product2

  -sgplot procedure

.

.

.

-etc

-When really what I would like is just:

-Product1

-Product2

-Product3

.

.

.

-Product22

So that each table of contents entry will bring me to the first of the 5 pages of output for that product.

Sorry if I am being unclear, I am trying to explain the best I can. Please let me know if I can provide any more clarification of my problem, or if you have any suggestions I can try.

Thanks a lot!!

-Ryan

Grand Advisor
Posts: 16,353

Re: ods pdf - table of contents

I don't know if there's a way to delete them, but you can hide them from showing by default by using pdftoc=1 in your ods pdf statement.

Frequent Contributor
Posts: 105

Re: ods pdf - table of contents

Ahh yes, I've tried that. The issue is though, that it wont conceal all of my procedures under the one label, it will only conceal the first sgplot, so i get some like:

+Product1

+Product1

   -sgplot procedure

+sgplot procedure

+sgplot procedure

+tabulate procedure

        -table1

+Product2

+Product2

  -sgplot procedure

+-sgplot procedure

.

.

.

etc.

Is there a way I can use this to conceal all procedure names underneath my custom proclabel? I don't care if there deleted or concealed under collapsed labels, either one will work for me!

Thanks!

SAS Super FREQ
Posts: 8,645

Re: ods pdf - table of contents

Hi:

  Look at this discussion of the  BOOKMARKGEN option (https://communities.sas.com/message/173478#173478). It shows how to selectively turn off the first bookmark, which is what this person wanted. But you could use a similar technique to turn BOOKMARKGEN=ON for the first procedure for Product1, then turn it off after the first procedure for the rest of the Product 1 procedures and then turn it back on for the first of the Product 2 procedures and turn it off for the rest of the Product 2 procedures. Conceptually like what's shown below. This bypasses the need to rename or adjust anything because you will only get a bookmark in the PDF toc for the 1st procedure for any product.

  You can change "The SGPLOT Procedure" subtitle using the DES= option on the PROC SGPLOT statement:

proc sgplot data=mydata.something des='My Pic';

...

run;

  And, while this will control the string that you see, you cannot get rid of the node entirely. The node will still be there, even if you make the string a blank.

  The only way to have a truly customized and restructured table of contents is to use ODS DOCUMENT/PROC DOCUMENT to create a new TOC structure and then copy objects into the new structure. But for what you want (to only go to the first "page" of any Product), I think the BOOKMARKGEN method will work for you.

cynthia

ods pdf file='bigdoc.pdf' bookmarkgen=on bookmarklist=show;

* first procedure for Product 1;

ods pdf bookmarkgen=off;

 

* second procedure;

* third procedure;

 

ods pdf bookmarkgen=on;

* first procedure for Product 2;

    

ods pdf bookmarkgen=off;

  

* second procedure;

* third procedure;

ods pdf close;

Post a Question
Discussion Stats
  • 3 replies
  • 425 views
  • 0 likes
  • 3 in conversation