Skip to content

Instantly share code, notes, and snippets.

@statgeek
Created December 6, 2014 03:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save statgeek/4f507ee768f51a355141 to your computer and use it in GitHub Desktop.
Save statgeek/4f507ee768f51a355141 to your computer and use it in GitHub Desktop.
SAS - Add by value title to GTL Template
*valid in SAS 9.3+, using the dynamic variable _byval_ that is automatically created by 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;
/*Reference:
http://support.sas.com/documentation/cdl/en/grstatug/63302/HTML/default/viewer.htm#n0c1svsedk2ptcn1gv0o80xfhyi6.htm
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment