From the log one can see, that you are using the SAS Report ODS destination. This one does not support gridded layout.
I made some changes to the code:
create sample data and provide a simple way to change the number of regions, numbers/trend are all random
create PDF output
paper size set to A3 to have more space, can be printed to A4
changed paper orientation to landscape
just one title line for each graph
Here is the code:
Data want;
length Region trend $ 16;
call streaminit(1234);
do n = 1 to 13;
region = cats("Region", put(n, z2.));
trend = choosec(rand("integer",1, 3), "Increasing", "Decreasing", "Neutral");
do repDate = 1 to 7;
cnt_11fnc = rand("integer", 1, 16);
avg_11fnc = rand("uniform") * 8;
output;
end;
end;
format
repdate 2.
cnt_11fnc 3.
avg_11fnc 4.1
;
run;
%macro plots;
%local i nObs region trend;
proc sql noprint;
select distinct
region
, trend
into
:regionValue1 -
, :trendValue1 -
from
want
;
%let nObs = &sqlobs;
quit;
%do i = 1 %to &nObs;
%let region = &®ionValue&i;
%let trend = &&trendValue&i;
%put NOTE: &sysmacroname processing &i of &nobs &=region &=trend;
ods region;
/* title1 "®ion";*/
%if &trend = Decreasing %then
%do;
title1 "®ion" c=red "&trend^{unicode '2198'x}";
%end;
%if &trend = Increasing %then
%do;
title1 "®ion" c=blue "&trend^{unicode '2197'x}";
%end;
%if &trend = Neutral %then
%do;
title1 "®ion" c=black "&trend^{unicode '2192'x}";
%end;
proc sgplot data=Want noautolegend;
where region = "®ion";
vbar RepDate / response=cnt_11FNC;
vline RepDate / response=avg_11FNC;
run;
%end;
ods layout end;
title;
%mend;
ods _all_ close;
ods escapechar="^";
options orientation=landscape papersize="A3" ;
ods pdf file="c:\temp\report.pdf" nogtitle;
title "Counts by Region";
ods graphics / width=72mm height=65mm;
ods layout gridded columns=5 column_gutter=5mm;
%plots
ods pdf close;
... View more