Hi,
I don't have a copy of SAS 9.1 to test this code, but I did get a modified version to work with 9.2 (9.2 has begingraph/endgraph blocks, the lattice layout option rowdatarange instead of hrange, and PROC SGRENDER). Depending on the status of dynamic variables as of 9.1, you might be able to use one for the ENTRY statements' text.
-Randy
data class(drop=height keep=weight height:);
set sashelp.class;
select (age);
when (11) height11=height;
when (12) height12=height;
when (13) height13=height;
when (14) height14=height;
when (15) height15=height;
when (16) height16=height;
otherwise;
end;
run;
ods graphics on;
proc template;
define statgraph lattice_test;
layout lattice / columns=2 columngutter=5 rowgutter=5 vrange=unionall;
cell;
cellheader;
entry "Age 11";
endcellheader;
scatterplot x=weight y=height11;
endcell;
cell;
cellheader;
entry "Age 12";
endcellheader;
scatterplot x=weight y=height12;
endcell;
cell;
cellheader;
entry "Age 13";
endcellheader;
scatterplot x=weight y=height13;
endcell;
cell;
cellheader;
entry "Age 14";
endcellheader;
scatterplot x=weight y=height14;
endcell;
cell;
cellheader;
entry "Age 15";
endcellheader;
scatterplot x=weight y=height15;
endcell;
cell;
cellheader;
entry "Age 16";
endcellheader;
scatterplot x=weight y=height16;
endcell;
endlayout;
end;
run;
data _null_;
set class;
attrib weight label='Weight' height: label='Height';
file print ods=(template='lattice_test');
put _ods_;
run;