GREPLAY Procedure

Using the GREPLAY Procedure to Replay Graphics Output in a Template

You can use the GREPLAY procedure to create new graphics output by replaying existing graphics output in templates. Templates are often used to replay several graphics entries from the same catalog on one display or page. The GREPLAY procedure creates new graphics output when replaying graphics output with a template.
You can create your own templates, or you can use the templates provided with SAS/GRAPH that are stored in the SASHELP.TEMPLT catalog.
The following guidelines describe how to generate two graphs, and replay the graphics output on one page using a SASHELP.TEMPLT entry:
  1. Generate two graphs with PROC GCHART using the default names (GCHART GCHART1).
  2. Start the GREPLAY procedure with the NOFS option specified.
  3. Define the input catalog with the IGOUT= option (WORK.GSEG).
  4. Assign the template catalog with the TC= option (SASHELP.TEMPLT contains the template entries).
  5. Assign a template to replay your graphs with the TEMPLATE statement (V2).
  6. Assign the graphs that you want to replay with the TREPLAY statement (GCHART GCHART1).
  7. End the GREPLAY procedure with the QUIT statement.
For example, the following statements replay the entries GRAPH1 and GRAPH2 into the V2 template, which is stored in the catalog SASHELP.TEMPLT. The TC statement specifies the catalog that contains the template, and the TEMPLATE statement specifies the template. The TREPLAY statement assigns each entry to a panel. (The V2 template has two panels, so there is an assignment for panel 1 and panel 2.)
proc gchart data=sashelp.class;
   hbar age/discrete;
    hbar height;
proc greplay igout=work.gseg nofs;
   tc sashelp.templt;
   template v2;
   treplay 1:gchart 2:gchart1;
Note: If the GOUT= option is not specified when creating the charts, then the output is stored in the temporary WORK.GSEG catalog.
When you replay graphics output in a template, the new GRSEG output that is created by the GREPLAY procedure is automatically provided a default name, Template, and it is stored in the output catalog WORK.GSEG. The default GRSEG description is “Graphics Replay”.