<?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 issues with pdf output using sgplot in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/issues-with-pdf-output-using-sgplot/m-p/434142#M20321</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am facing problems with the pdf output with several graphs included. I have two databases, from each of them I create by macro loop set of 6 graphs. I would like to have first 6 graphs on the page 1, graphs&amp;nbsp;from the second&amp;nbsp;loop on the second page. The&amp;nbsp;pdf output I currently obtain&amp;nbsp;contains several attributes I would like to change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My issues are as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) If I run the code for the first time, there are no titles of the pages. All the graphs have its own - loop-specific - title, but there is no header of the pdf page. If I run the code for the second time, there is a header&amp;nbsp;on each pdf page with the values of &amp;amp;saz and &amp;amp;taf from the second loop. Why is it so and is there some simple way how to create page-specific header ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) The second issue concerns the bookmarks. Each graph has its own clickable bookmark created by the command ods proclabel. But is there a way how to have just one bookmark per pdf page, not six the same ones ? The secondary bookmarks are hidden by the&lt;/P&gt;&lt;P&gt;command pdftoc = 1. Is there a way how to remove them totally ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) Despite the fact the loop runs 2 times, there are 3 pdf pages created. It seems it is because of the command &lt;EM&gt;ods pdf startpage=now&lt;/EM&gt;. Is there a way how to remove the blank page (either at the beginning of the document or at the end depending on the location of the ods command) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any suggestions which way to correct the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data out_i_a; set sashelp.retail; run;
data out_ii_b; set sashelp.retail; run; 

data y;
length saz tef x1 x2 $100;
input saz $ tef $ x1 $ x2; 
datalines;
I A desc1 desc1a
II B desc2 desc2a
;
run;


%macro jed();
proc sql;
    select count(*) into: pocet from y;
quit;

ods _all_ close;
options /*papersize="ISO A4"*/ orientation=portrait;
ods pdf file="\\srv35\\GRAF\AA_BB.pdf" /*style=bigger*/ pdftoc=1;
ods graphics / width=10cm height=8cm;

ods layout gridded columns=2;

%do i=1 %to &amp;amp;pocet;
title "TITLE - &amp;amp;saz. &amp;amp;tef.";

data _null_;
   set y (obs=&amp;amp;i);
   call symput("saz" ,strip(saz));
   call symput("tef" ,strip(tef));
   call symput("x1" ,strip(x1));
   call symput("x2" ,strip(x2));
run;

ods region;
ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";
proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
series x=date y=sales / legendlabel="sales"; 
series x=date y=year/y2axis legendlabel="year";
xaxis label="date";
yaxis label="sales";
y2axis label="year";
TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - #";
run;

ods region;
ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";
proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
series x=date y=sales / legendlabel="sales"; 
series x=date y=year/y2axis legendlabel="year";
xaxis label="date";
yaxis label="sales";
y2axis label="year";
TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - rate";
run;

ods region;
ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";
proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
series x=date y=sales / legendlabel="sales"; 
series x=date y=year/y2axis legendlabel="year";
xaxis label="date";
yaxis label="sales";
y2axis label="year";
TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - #";
run;

ods region;
ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";
proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
series x=date y=sales / legendlabel="sales"; 
series x=date y=year/y2axis legendlabel="year";
xaxis label="date";
yaxis label="sales";
y2axis label="year";
TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - rate";
run;

ods region;
ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";
proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
series x=date y=sales / legendlabel="sales"; 
series x=date y=year/y2axis legendlabel="year";
xaxis label="date";
yaxis label="sales";
y2axis label="year";
TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - #";
run;

ods region;
ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";
proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
series x=date y=sales / legendlabel="sales"; 
series x=date y=year/y2axis legendlabel="year";
xaxis label="date";
yaxis label="sales";
y2axis label="year";
TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - rate";
run;

ods pdf startpage=now; 
%end;
ods layout end;
ods pdf close;

%mend;
%jed;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 05 Feb 2018 12:44:37 GMT</pubDate>
    <dc:creator>jj_jj</dc:creator>
    <dc:date>2018-02-05T12:44:37Z</dc:date>
    <item>
      <title>issues with pdf output using sgplot</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/issues-with-pdf-output-using-sgplot/m-p/434142#M20321</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am facing problems with the pdf output with several graphs included. I have two databases, from each of them I create by macro loop set of 6 graphs. I would like to have first 6 graphs on the page 1, graphs&amp;nbsp;from the second&amp;nbsp;loop on the second page. The&amp;nbsp;pdf output I currently obtain&amp;nbsp;contains several attributes I would like to change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My issues are as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) If I run the code for the first time, there are no titles of the pages. All the graphs have its own - loop-specific - title, but there is no header of the pdf page. If I run the code for the second time, there is a header&amp;nbsp;on each pdf page with the values of &amp;amp;saz and &amp;amp;taf from the second loop. Why is it so and is there some simple way how to create page-specific header ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) The second issue concerns the bookmarks. Each graph has its own clickable bookmark created by the command ods proclabel. But is there a way how to have just one bookmark per pdf page, not six the same ones ? The secondary bookmarks are hidden by the&lt;/P&gt;&lt;P&gt;command pdftoc = 1. Is there a way how to remove them totally ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) Despite the fact the loop runs 2 times, there are 3 pdf pages created. It seems it is because of the command &lt;EM&gt;ods pdf startpage=now&lt;/EM&gt;. Is there a way how to remove the blank page (either at the beginning of the document or at the end depending on the location of the ods command) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any suggestions which way to correct the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data out_i_a; set sashelp.retail; run;
data out_ii_b; set sashelp.retail; run; 

data y;
length saz tef x1 x2 $100;
input saz $ tef $ x1 $ x2; 
datalines;
I A desc1 desc1a
II B desc2 desc2a
;
run;


%macro jed();
proc sql;
    select count(*) into: pocet from y;
quit;

ods _all_ close;
options /*papersize="ISO A4"*/ orientation=portrait;
ods pdf file="\\srv35\\GRAF\AA_BB.pdf" /*style=bigger*/ pdftoc=1;
ods graphics / width=10cm height=8cm;

ods layout gridded columns=2;

%do i=1 %to &amp;amp;pocet;
title "TITLE - &amp;amp;saz. &amp;amp;tef.";

data _null_;
   set y (obs=&amp;amp;i);
   call symput("saz" ,strip(saz));
   call symput("tef" ,strip(tef));
   call symput("x1" ,strip(x1));
   call symput("x2" ,strip(x2));
run;

ods region;
ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";
proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
series x=date y=sales / legendlabel="sales"; 
series x=date y=year/y2axis legendlabel="year";
xaxis label="date";
yaxis label="sales";
y2axis label="year";
TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - #";
run;

ods region;
ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";
proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
series x=date y=sales / legendlabel="sales"; 
series x=date y=year/y2axis legendlabel="year";
xaxis label="date";
yaxis label="sales";
y2axis label="year";
TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - rate";
run;

ods region;
ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";
proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
series x=date y=sales / legendlabel="sales"; 
series x=date y=year/y2axis legendlabel="year";
xaxis label="date";
yaxis label="sales";
y2axis label="year";
TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - #";
run;

ods region;
ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";
proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
series x=date y=sales / legendlabel="sales"; 
series x=date y=year/y2axis legendlabel="year";
xaxis label="date";
yaxis label="sales";
y2axis label="year";
TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - rate";
run;

ods region;
ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";
proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
series x=date y=sales / legendlabel="sales"; 
series x=date y=year/y2axis legendlabel="year";
xaxis label="date";
yaxis label="sales";
y2axis label="year";
TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - #";
run;

ods region;
ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";
proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
series x=date y=sales / legendlabel="sales"; 
series x=date y=year/y2axis legendlabel="year";
xaxis label="date";
yaxis label="sales";
y2axis label="year";
TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - rate";
run;

ods pdf startpage=now; 
%end;
ods layout end;
ods pdf close;

%mend;
%jed;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Feb 2018 12:44:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/issues-with-pdf-output-using-sgplot/m-p/434142#M20321</guid>
      <dc:creator>jj_jj</dc:creator>
      <dc:date>2018-02-05T12:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: issues with pdf output using sgplot</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/issues-with-pdf-output-using-sgplot/m-p/434264#M20325</link>
      <description>&lt;P&gt;hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have made some changes to your code, see below.&lt;/P&gt;
&lt;P&gt;To have an overall title for the page, use a TITLE statement before starting the layout.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Close a layout at the end of the page.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use ODS PDF BOOKMARKGEN and NOBOOKMARKGEN to&amp;nbsp;control whether bookmarks are created or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the DESCRIPTION option on Proc SGPLOT to control the text of the second level bookmark.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data out_i_a;
  set sashelp.retail;
run;

data out_ii_b;
  set sashelp.retail;
run;

data y;
  length saz tef x1 x2 $100;
  input saz $ tef $ x1 $ x2;
  datalines;
I A desc1 desc1a
II B desc2 desc2a
;
run;

%macro jed();

  proc sql;
    select count(*) into: pocet from y;
  quit;

  ods _all_ close;
  options /*papersize="ISO A4"*/
  orientation=portrait;
  ods pdf file="c:\temp\AA_BB.pdf" /*style=bigger*/
  pdftoc=1;
  ods graphics / width=10cm height=8cm;

  /* overall title */
  %do i=1 %to &amp;amp;pocet;

    data _null_;
      set y (obs=&amp;amp;i);
      call symput("saz" ,strip(saz));
      call symput("tef" ,strip(tef));
      call symput("x1" ,strip(x1));
      call symput("x2" ,strip(x2));
    run;

    /* switch on bookmarks */
    ods pdf bookmarkgen;
    /* overall title before layout */
    title "TITLE - &amp;amp;saz. &amp;amp;tef.";
    ods layout gridded columns=2;
ods region;
  ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";

  proc sgplot data=out_&amp;amp;saz._&amp;amp;tef. des="sugus";
    series x=date y=sales / legendlabel="sales";
    series x=date y=year/y2axis legendlabel="year";
    xaxis label="date";
    yaxis label="sales";
    y2axis label="year";
    TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - #";
  run;
/* switch off bookmarks */
  ods pdf nobookmarkgen;
ods region;
  ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";

  proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
    series x=date y=sales / legendlabel="sales";
    series x=date y=year/y2axis legendlabel="year";
    xaxis label="date";
    yaxis label="sales";
    y2axis label="year";
    TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - rate";
  run;

ods region;
  ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";

  proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
    series x=date y=sales / legendlabel="sales";
    series x=date y=year/y2axis legendlabel="year";
    xaxis label="date";
    yaxis label="sales";
    y2axis label="year";
    TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - #";
  run;

ods region;
  ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";

  proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
    series x=date y=sales / legendlabel="sales";
    series x=date y=year/y2axis legendlabel="year";
    xaxis label="date";
    yaxis label="sales";
    y2axis label="year";
    TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - rate";
  run;

ods region;
  ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";

  proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
    series x=date y=sales / legendlabel="sales";
    series x=date y=year/y2axis legendlabel="year";
    xaxis label="date";
    yaxis label="sales";
    y2axis label="year";
    TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - #";
  run;

ods region;
  ODS PROCLABEL "&amp;amp;saz. &amp;amp;tef. &amp;amp;x1.";

  proc sgplot data=out_&amp;amp;saz._&amp;amp;tef.;
    series x=date y=sales / legendlabel="sales";
    series x=date y=year/y2axis legendlabel="year";
    xaxis label="date";
    yaxis label="sales";
    y2axis label="year";
    TITLE "&amp;amp;saz. &amp;amp;tef. Y1 - rate";
  run;
/* end layout at end of page */
ods layout end;
ods pdf startpage=now;
  %end;

  ods pdf close;
%mend;

%jed;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Feb 2018 17:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/issues-with-pdf-output-using-sgplot/m-p/434264#M20325</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2018-02-05T17:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: issues with pdf output using sgplot</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/issues-with-pdf-output-using-sgplot/m-p/434475#M20334</link>
      <description>Thank you a lot, I was getting a bit desparate.</description>
      <pubDate>Tue, 06 Feb 2018 07:28:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/issues-with-pdf-output-using-sgplot/m-p/434475#M20334</guid>
      <dc:creator>jj_jj</dc:creator>
      <dc:date>2018-02-06T07:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: issues with pdf output using sgplot</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/issues-with-pdf-output-using-sgplot/m-p/445486#M20626</link>
      <description>&lt;P&gt;I have broadened my problem and would be really thankful with any&amp;nbsp;additional advice&amp;nbsp;- &lt;A href="https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/adding-page-just-with-the-text-to-the-ods-pdf-output/m-p/445484#M15318" target="_blank"&gt;https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/adding-page-just-with-the-text-to-the-ods-pdf-output/m-p/445484#M15318&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 14:26:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/issues-with-pdf-output-using-sgplot/m-p/445486#M20626</guid>
      <dc:creator>jj_jj</dc:creator>
      <dc:date>2018-03-14T14:26:22Z</dc:date>
    </item>
  </channel>
</rss>

