SAS动态输出保存文件

时间:2014-12-06 03:04:31

标签: dynamic graph save sas output

我正在使用proc模板和sgrender并根据类变量(classVar)输出ODS。我需要使用类变量的名称更新每个图形的输出标题。以下是我的代码示例:

proc template;
  define statgraph heatmapparm;
  dynamic _BYVAL_;
    begingraph;
      entrytitle _BYVAL_;
      layout overlay;
        heatmapparm x=X_VAR y=Y_VAR colorresponse=percent / colormodel=(blue yellow red)
          name="heatmapparm" xbinaxis=false ybinaxis=false datatransparency=.5;
        continuouslegend "heatmapparm" / location=outside valign=bottom;
      endlayout;
    endgraph;
  end;
run;

proc sgrender data=roundFreq template=heatmapparm;
    by situation;
run;

谢谢大家的帮助!

1 个答案:

答案 0 :(得分:2)

我认为这适用于SAS 9.3+。你有什么版本的SAS?

proc template;
define statgraph scatter;
dynamic _x _y _byval_;

 begingraph;
 entrytitle "Scatter Plot of " _x " by " _y " for Sex = " _byval_;
   layout overlay;
     scatterplot x=_x y=_y;
   endlayout;
 endgraph;
end;

run;

proc sort data=sashelp.class out=class;
by sex;
run;

proc sgrender data=class
          template=scatter;
 by sex;
dynamic _x='height' _y='weight';
run;