<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Creating single level PDF bookmark for multi-page SAS GRAPH via PROC DOCUMENT in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-single-level-PDF-bookmark-for-multi-page-SAS-GRAPH-via/m-p/667157#M24251</link>
    <description>&lt;P&gt;The trick of not having the procedures generate the bookmark, but instead creating one yourself should work with SGraph procedures just as well.&amp;nbsp;&lt;BR /&gt;I modified your code a bit, does this come close to what you are looking for ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods document name=temp(write);   

proc sort data=sashelp.class out=class; by sex; run;

ods noproctitle;
ods proclabel="";
proc sgplot data=class description="";
 by sex;
 scatter x=height y=weight;
run;

ods document close;

/* Create data set from all levels */
 ods output properties=temp;                                                                                                            
proc document name=temp;                                                                                                                
   list / levels=all;                                                                                                                      
run;                                                                                                                                    
quit;                                                                                                                                   
      
/* Create a unique macro variable for each object */
data _null_;                                                                                                                            
   set temp end=last;                                                                                                                    
   if type in("Table","Report","Graph") then do;
      count+1; 
      call symput('path'||trim(left(count)),path); 
   end; 
   if last then call symput('total',count); 
run;  
                                                                                                                   
 /* Loop through each macro variable and copy the output */
 /* object to a new folder and then replay it.           */

%macro test;  

ods pdf file="c:\temp\want.pdf" startpage=no;
ODS PROCLABEL 'First bookmark';


data _null_;
  declare odsout ODS();
  ODS.note(data: " ",  style_attr: 'font_size=1pt');
run;

ods pdf nobookmarkgen;

   proc document name=temp; 
      make \ newfolder; 
      setlabel \ newfolder "I only want one level of bookmark for this SGPLOT";
      %do i=1 %to &amp;amp;total; 
         copy &amp;amp;&amp;amp;path&amp;amp;i to \ newfolder#1;
      %end;                                                                                                                                   
      replay \newfolder;                                                                                                                      
   run;                                                                                                                                    
   quit; 

%mend;                                                                                                                                  
                                                                                                                   
%test;

ods pdf close; &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 06 Jul 2020 12:40:05 GMT</pubDate>
    <dc:creator>MCoopmans</dc:creator>
    <dc:date>2020-07-06T12:40:05Z</dc:date>
    <item>
      <title>Creating single level PDF bookmark for multi-page SAS GRAPH via PROC DOCUMENT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-single-level-PDF-bookmark-for-multi-page-SAS-GRAPH-via/m-p/634979#M23892</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to run SAS graph into a sas item store before replaying into a single PDF using PROC DOCUMENT and the issue I have is that I only want to present the top level bookmark in the PDF.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see various methods and solutions for achieving this for PROC REPORT (using the contents ="") however I cannot find a similar SAS/GRAPH solution for when the graphs span more than one page.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the description option only controls the bookmark name, and when setting description = "" this only creates a blank bookmark where as I do not want this bookmark creating at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is some sample code to show the issue I face.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be very much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods document name=temp(write);   

proc sort data=sashelp.class out=class; by sex; run;

ods noproctitle;
ods proclabel="";
proc sgplot data=class description="";
 by sex;
 scatter x=height y=weight;
run;

ods document close;

/* Create data set from all levels */
 ods output properties=temp;                                                                                                            
proc document name=temp;                                                                                                                
   list / levels=all;                                                                                                                      
run;                                                                                                                                    
quit;                                                                                                                                   
      
/* Create a unique macro variable for each object */
data _null_;                                                                                                                            
   set temp end=last;                                                                                                                    
   if type in("Table","Report","Graph") then do;
      count+1; 
      call symput('path'||trim(left(count)),path); 
   end; 
   if last then call symput('total',count); 
run;  
                                                                                                                   
 /* Loop through each macro variable and copy the output */
 /* object to a new folder and then replay it.           */
%macro test;  

   ods pdf file="temp.pdf"; 
   proc document name=temp; 
      make \ newfolder; 
      setlabel \ newfolder "I only want one level of bookmark for this SGPLOT";
      %do i=1 %to &amp;amp;total; 
         copy &amp;amp;&amp;amp;path&amp;amp;i to \ newfolder#1;
      %end;                                                                                                                                   
      replay \newfolder;                                                                                                                      
   run;                                                                                                                                    
   quit; 

   ods pdf close; 
%mend;                                                                                                                                  
                                                                                                                                          
%test;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Mar 2020 08:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-single-level-PDF-bookmark-for-multi-page-SAS-GRAPH-via/m-p/634979#M23892</guid>
      <dc:creator>cjridley</dc:creator>
      <dc:date>2020-03-26T08:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Creating single level PDF bookmark for multi-page SAS GRAPH via PROC DOCUMENT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-single-level-PDF-bookmark-for-multi-page-SAS-GRAPH-via/m-p/667157#M24251</link>
      <description>&lt;P&gt;The trick of not having the procedures generate the bookmark, but instead creating one yourself should work with SGraph procedures just as well.&amp;nbsp;&lt;BR /&gt;I modified your code a bit, does this come close to what you are looking for ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods document name=temp(write);   

proc sort data=sashelp.class out=class; by sex; run;

ods noproctitle;
ods proclabel="";
proc sgplot data=class description="";
 by sex;
 scatter x=height y=weight;
run;

ods document close;

/* Create data set from all levels */
 ods output properties=temp;                                                                                                            
proc document name=temp;                                                                                                                
   list / levels=all;                                                                                                                      
run;                                                                                                                                    
quit;                                                                                                                                   
      
/* Create a unique macro variable for each object */
data _null_;                                                                                                                            
   set temp end=last;                                                                                                                    
   if type in("Table","Report","Graph") then do;
      count+1; 
      call symput('path'||trim(left(count)),path); 
   end; 
   if last then call symput('total',count); 
run;  
                                                                                                                   
 /* Loop through each macro variable and copy the output */
 /* object to a new folder and then replay it.           */

%macro test;  

ods pdf file="c:\temp\want.pdf" startpage=no;
ODS PROCLABEL 'First bookmark';


data _null_;
  declare odsout ODS();
  ODS.note(data: " ",  style_attr: 'font_size=1pt');
run;

ods pdf nobookmarkgen;

   proc document name=temp; 
      make \ newfolder; 
      setlabel \ newfolder "I only want one level of bookmark for this SGPLOT";
      %do i=1 %to &amp;amp;total; 
         copy &amp;amp;&amp;amp;path&amp;amp;i to \ newfolder#1;
      %end;                                                                                                                                   
      replay \newfolder;                                                                                                                      
   run;                                                                                                                                    
   quit; 

%mend;                                                                                                                                  
                                                                                                                   
%test;

ods pdf close; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Jul 2020 12:40:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-single-level-PDF-bookmark-for-multi-page-SAS-GRAPH-via/m-p/667157#M24251</guid>
      <dc:creator>MCoopmans</dc:creator>
      <dc:date>2020-07-06T12:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Creating single level PDF bookmark for multi-page SAS GRAPH via PROC DOCUMENT</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-single-level-PDF-bookmark-for-multi-page-SAS-GRAPH-via/m-p/684949#M24470</link>
      <description>&lt;P&gt;Hi Mathias.. thanks for the response&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whilst the below statement has the desired outcome of only creating the output with 1 bookmark, this also affects the actual plot where a 3 page document is created with the first 2 pages blank and then the third&amp;nbsp;shows only a truncated part of the plot.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  declare odsout ODS();
  ODS.note(data: " ",  style_attr: 'font_size=1pt');
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I'm not so familiar with controlling ODS documents from a datastep, so any pointers to address this would be really appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 12:25:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Creating-single-level-PDF-bookmark-for-multi-page-SAS-GRAPH-via/m-p/684949#M24470</guid>
      <dc:creator>cjridley</dc:creator>
      <dc:date>2020-09-18T12:25:11Z</dc:date>
    </item>
  </channel>
</rss>

