A data object can be
converted to a SAS data set with the ODS OUTPUT statement. Generally,
you identify the data object to convert, and assign it a data set
name.
When a GTL template
is executed with PROC SGRENDER, the output data object is always named
SGRENDER. Thus, you can identify the data object by that name in the
ODS OUTPUT statement. The following example converts the data object
to a SAS data set named REGFIT1:
ods output sgrender=regfit1;
proc sgrender data=sashelp.class template=mygraphs.regfit;
dynamic xvar="height" yvar="weight";
run;
Because
the output object name from the DATA step changes with each execution,
it is handy to use the OBJECT= option on the DATA step FILE statement
to set the object name so that it is easy to identify for the conversion.
The following example
assigns the name DATAOBJ to the data object and uses that name to
convert the data object to a SAS data set named REGFIT2:
ods output dataobj=regfit2 ;
data _null_;
if _n_=1 then call symput("study","CLASS dataset");
set sashelp.class;
file print ods=( template="mygraphs.regfit"
dynamic=( xvar="height" yvar="weight" )
object=dataobj );
put _ods_;
run;