Hi,
Another way of doing this is to get rid of the by statement in the proc sgrender, and use a do loop to go through the data. This will enable you to create the macrovar you want, and use it in a title statement. I'm not sure if this is still relevant for Mathias (after two years), but just in case here is an example;
/*--------------------------------------------------------*/
ods path(prepend) work.templat(update);
%let timeframe=semiyear;
proc template; define statgraph sgnoby; begingraph; layout overlay; scatterplot x=PAN y=PANF / name='scatter' ; endlayout; endgraph; end; run;
data _null_; set SASHELP.CITIYR end=last; call symput ('date'||strip(put(_n_,best.)),date); if last then call symput('ndates',strip(put(_n_,best.))); run;
%macro noby;
%do i=1 %to &ndates;
data _null_; set SASHELP.CITIYR(where=(date=&&date&i)); call symput('realdate',strip(put(date,date9.))); call symput('mdupdate',strip(put((INTNX("&timeframe",(date),1)),date9.))); run;
title "&realdate" ' - ' "&mdupdate"; proc sgrender data=SASHELP.CITIYR(where=(date=&&date&i)) template=sgnoby; options nobyline; run;
%end;
%mend noby;
%noby
/*--------------------------------------------------------*/
... View more