Hello, 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 from the second loop on the second page. The pdf output I currently obtain contains several attributes I would like to change. My issues are as follows: 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 on each pdf page with the values of &saz and &taf from the second loop. Why is it so and is there some simple way how to create page-specific header ? 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 command pdftoc = 1. Is there a way how to remove them totally ? 3) Despite the fact the loop runs 2 times, there are 3 pdf pages created. It seems it is because of the command ods pdf startpage=now. 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) ? Thank you for any suggestions which way to correct the code. 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 &pocet;
title "TITLE - &saz. &tef.";
data _null_;
set y (obs=&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 "&saz. &tef. &x1.";
proc sgplot data=out_&saz._&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 "&saz. &tef. Y1 - #";
run;
ods region;
ODS PROCLABEL "&saz. &tef. &x1.";
proc sgplot data=out_&saz._&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 "&saz. &tef. Y1 - rate";
run;
ods region;
ODS PROCLABEL "&saz. &tef. &x1.";
proc sgplot data=out_&saz._&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 "&saz. &tef. Y1 - #";
run;
ods region;
ODS PROCLABEL "&saz. &tef. &x1.";
proc sgplot data=out_&saz._&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 "&saz. &tef. Y1 - rate";
run;
ods region;
ODS PROCLABEL "&saz. &tef. &x1.";
proc sgplot data=out_&saz._&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 "&saz. &tef. Y1 - #";
run;
ods region;
ODS PROCLABEL "&saz. &tef. &x1.";
proc sgplot data=out_&saz._&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 "&saz. &tef. Y1 - rate";
run;
ods pdf startpage=now;
%end;
ods layout end;
ods pdf close;
%mend;
%jed;
... View more