Hi Cynthia, Thanks for replying. %MACRO graphic_template(across, down, startNum, endNum, oPath,oFileName); %let npanels=%eval(&down*&across); data numgraf; ymult=100/&down; /* Y increment for panels. */ xmult=100/&across; /* X increment for panels. */ run; data coord; set numgraf; do x=0 to (100-xmult) by xmult; /* Calculate X coordinate values. */ llx=x; /* Lower-left X. */ ulx=x; /* Upper-left X. */ urx=x+xmult; /* Upper-right X. */ lrx=x+xmult; /* Lower-right X. */ do y=0 to (100-ymult) by ymult; /* Calculate Y coordinate values. */ lly=y; /* Lower-left Y. */ uly=y+ymult; /* Upper-left Y. */ ury=y+ymult; /* Upper-right Y. */ lry=y; /* Lower-right Y. */ output; end; end; run; proc sort data=coord; by descending y; run; data mccoord; set coord end=eof; call symput('llx'||left(_n_),llx); call symput('ulx'||left(_n_),ulx); call symput('urx'||left(_n_),urx); call symput('lrx'||left(_n_),lrx); call symput('lly'||left(_n_),lly); call symput('uly'||left(_n_),uly); call symput('ury'||left(_n_),ury); call symput('lry'||left(_n_),lry); if eof then call symput('total',_n_); run; %let replay_num=&startNum:1; %let n=2; %do i=%eval(&startNum+1) %to &endNum; %let nnn=&i:&n; %let replay_num=&replay_num &nnn; %let n=%eval(&n+1); %end; %put &replay_num; ods listing; proc greplay nofs igout=work.gseg tc=work.templt template =Spec&npanels ; tdef spec&npanels %tempdef; filename out1 "&oPath.\&oFileName..emf"; goptions device=gif gsfname=out1 gsfmode=replace hsize = 8.33 vsize =6.03; treplay &replay_num ; quit; ods listing close; %MEND; Here is the code, towards the end there is a proc greplay statement, and from the output, that's where the problem is showing. For each result, there is a univariate output(histogram) , which is correct, but also a greplay output, which is the wrong one. Note that if i reboot SAS, so that all SAS temp files would be gone, and rerun this code, i would get the desired graphs, I think it must be with the setting of ODS or something. Hope you could help.
... View more