My problem is as follows - I have two datasets, out of which I create through macro loop 2 * 2 graphs. I plot these two graphs into the pdf file having the first 2 graphs on the page 1 and the other graphs on the page 2.
The output pdf is fine, the only thing I would like to change are bookmarks. I would like them to contain some detailed information about the graphs - one separate original bookmark per each graph.
Is there some simple way how to do that ? I have found out some complicated solutions through proc report, but is there any easy way for my current code ?
data out_i_a; set sashelp.retail; run;
data out_ii_b; set sashelp.retail; run;
data y;
length saz tef $100;
input saz $ tef $;
datalines;
i a
ii b
;
run;
%macro grafy();
proc sql;
select count(*) into: pocet from y;
quit;
ods _all_ close;
goptions hsize=20cm vsize=8cm;
ods pdf file="\\srv05\nt05a\GRAF\TOT_testing.pdf";
ods layout gridded columns=1;
%do i=1 %to &pocet;
data _null_;
set y (obs=&i);
call symput("saz" ,strip(saz));
call symput("tef" ,strip(tef));
run;
ods region;
ods pdf text="&saz._&tef";
symbol1 interpol=join height=10pt VALUE=NONE LINE=1 WIDTH=1 CV= _STYLE_;
symbol2 interpol=join height=10pt VALUE=NONE LINE=1 WIDTH=1 CV= _STYLE_;
Legend1 value=('SALES' 'YEAR');
axis1 label=('# sales');
axis3 label=('# year');
axis2 label=('date');
proc gplot data= out_&saz._&tef;
plot (SALES)*DATE / overlay skipmiss
VAXIS=AXIS1
HAXIS=AXIS2 LEGEND=Legend1;
plot2 (YEAR)*DATE / overlay skipmiss
VAXIS=AXIS3
HAXIS=AXIS2 LEGEND=Legend1;
run;
ods region;
symbol1 interpol=join height=10pt VALUE=NONE LINE=1 WIDTH=1 CV= _STYLE_;
symbol2 interpol=join height=10pt VALUE=NONE LINE=1 WIDTH=2 CV= _STYLE_;
Legend1 value=('year' 'month');
axis1 label=('in %, p.a.');
axis2 label=('date');
proc gplot data= out_&saz._&tef;
plot (YEAR MONTH)*DATE / overlay skipmiss
VAXIS=AXIS1
HAXIS=AXIS2 LEGEND=Legend1;
run;
%end;
ods layout end;
ods pdf close;
%mend;
%grafy();
The current bookmarks - to be changed - are created automatically and are as follows:
The GPlot Procedure - Plot of YEAR by DATE
The GPlot Procedure - Plot of MONTH by DATE
The GPlot Procedure - Plot of YEAR by DATE
The GPlot Procedure - Plot of MONTH by DATE