SAS Institute. The Power to Know

SAS/GRAPH(R) 9.2: Graph Template Language Reference

Previous | Next
Overview

Template Compilation

A GTL template describes the structure and appearance of a graph to be produced, similar to the way a TABLE template describes the organization and content of a table.

All templates are stored, compiled programs. The following source program produces a simple GTL template named SCATTER:

  
 proc template; 
   define statgraph scatter; 
     begingraph; 
       layout overlay; 
         scatterplot x=height y=weight; 
       endlayout; 
     endgraph; 
  end; 
 run;
 

When this code is submitted, the statement keywords and options are parsed, just as with any other procedure. If no syntax error is detected, an output template named SCATTER is created and stored in the default template folder SASUSER.TEMPLAT. No graph is produced. Note the following:

  • Any required arguments in the template must be specified. In this example, X= and Y= on the SCATTERPLOT statement must specify variables for the analysis, but no checking for the existence of these variables is done at compile time.
  • No reference to an input data set appears in the template.

Previous | Next | Top of Page