| TEMPLATE Procedure: ODS Graphics Overview (Experimental) |
| Terminology |
The following terms frequently appear in the discussions of ODS graphics:
is a form, similar to a SAS data set, that contains the results (numbers and characters) of a DATA step or PROC step that supports ODS.
describes how to display the output for an ODS statistical graph output object. A graph definition determines the layout and details of graphs produced with ODS Graphics. Graph definitions begin with a DEFINE STATGRAPH statement and end with an END statement. An ODS statistical graph definition is the same as a graph template definition.
is an object that contains both the results of a DATA step or PROC step and information about how to format the results. An output object has a name, label, and path.
is a set of ODS statements that are specified within the TEMPLATE procedure to create a table, column, header, footer, style, tagset, or ODS statistical graph definition.
is an item store which stores definitions that were created by the TEMPLATE procedure. Definitions that SAS provides are in the template store SASHELP.TMPLMST. You can store definitions that you create in any template store where you have write access.
Note: A template store can contain multiple levels known as directories. When you specify a template store in the ODS PATH statement, however, you specify a two-level name that includes a libref and the name of a template store in the SAS data library that the libref references.
| What Are ODS Statistical Graph Definitions? |
ODS statistical graph definitions are templates that control the format and appearance of ODS statistical graphs, and associate variable roles in the graphs with specific data columns from the data source. The definitions can be created or modified by using PROC TEMPLATE. You can request plot types (such as scatter plots), specify plot layouts, and change details such as axis scaling and labeling. Options are available for specifying attributes such as colors and fonts. A default set of graph definitions are provided for a number of SAS statistical procedures. You can customize the graphics output from a statistical procedure by modifying the definition that is used by that procedure.
ODS statistical graph definitions are self-contained, and do not support inheritance from a parent definition, as do table definitions. Also, ODS statistical graphs cannot be modified by using the EDIT statement.
| Exploring an ODS Statistical Graph Definition |
Like an ODS table, style, or tagset definition, an ODS statistical graph definition is specified within PROC TEMPLATE statements. The following example shows the structure of an ODS statistical graph definition:
proc template; define statgraph name-of-graph-definition;notes "template-documentation";
dynamic variables;
mvar variables;
nmvar variables;
layout overlay;
scatterplot x=column y=column;
lineparm slope=number yintercept=number;
entrytitle="Your Title";
endlayout;
end;
run;
Note: You must execute a SAS procedure that supports ODS Graphics in order to get a graph output object. If you submit an ODS statistical graph definition by itself, then you will not create a graph output object.
The ODS Graphic statements must be nested within a DEFINE STATGRAPH
block.
When creating an ODS statistical graph definition, the standard
PROC TEMPLATE declaration statements (DYNAMIC, MVAR, NMVAR, and NOTES) are
used in the same way as they are when defining an ODS table definition.
The plot statements must be nested within a LAYOUT statement
block.
The plot statements specify the type of plot that you want
to create. The above example uses two plot statements which create a scatter
plot overlaid with a line.
Text statements must be within a LAYOUT statement block.