/***************************************************************************************************************** SAS file name: TMPLOUT_Option.sas File location: _________________________________________________________________________________________________________________ Purpose: To demonstrate the use of the TMPLOUT= Option in PROC SGPLOT Author: Peter Clemmensen Creation Date: 07/09/2017 THis program supports the blog post "Using the TMPLOUT= Option in SG Procedures" on SASnrd.com *****************************************************************************************************************/ ods graphics on; /* Define the path and filename for template code */ %let path=C:\Users\Peter\Desktop; %let file=ScatterTemplate; /* Draw simple scatter plot with PROC SGPLOT and save generated template on your desktop as .sas file */ proc sgplot data=sashelp.class tmplout="&path.\&file..sas"; title "Simple Scatter Plot"; scatter y=weight x=height; run; /* Display generated PROC TEMPLATE code in log, when included next */ options source2; /* Run the generated template code */ %include "&path.\&file..sas"; /* Use PROC SGRENDER along with the generated template to draw the exact same plot as the PROC SGPLOT above */ proc sgrender data=sashelp.class template=sgplot; run;