SUPPORT / SAMPLES & SAS NOTES
 

Support

Usage Note 48183: Using PROC GREPLAY to put multiple graphs on the same page

DetailsAboutRate It
The GREPLAY procedure is a SAS/GRAPH® procedure whose main purpose is to combine multiple graphs on a single page. This includes putting multiple graphs on a single PDF or RTF page, on a single web page, and on a single display.

You can also use PROC GREPLAY to delete one or more entries from an existing graphics catalog, overlay multiple graphs, and to simplify the table of contents when using ODS.

The GREPLAY procedure can only replay graphics output that has been written as an entry to a SAS/GRAPH catalog. Keep in mind that not all of the SAS procedures that produce graphics output write a GRSEG entry to a SAS/GRAPH catalog. Graphics output that is not written to a SAS/GRAPH catalog includes graphics output from the following:

  • PROC SGPLOT
  • PROC SGPANEL
  • PROC SGSCATTER
  • PROC SGRENDER
  • PROC GTILE
  • PROC GKPI
  • ODS Statistical Graphics
Note that you can use the GREPLAY procedure to replay graphics output created by SAS/STAT® and SAS/QC® procedures, such as BOXPLOT and SHEWHART, as long as ODS Graphics is not enabled for these procedures.

PROC GREPLAY also cannot replay text output produced by procedures such as PROC PRINT or PROC REPORT.

Most SAS/GRAPH device drivers support the GREPLAY procedure. However, the following device drivers do not support PROC GREPLAY:

  • ACTIVEX
  • ACTXIMG
  • JAVA
  • JAVAIMG
Here are some alternatives to using PROC GREPLAY to combine multiple graphs on a single page:

  • The HTMLPANEL tagset (which puts multiple graphs and tables on a single web page). Refer to Sample 38066 for sample code that demonstrates how to use the HTMLPANEL tagset.
  • ODS Layout (which puts multiple graphs and tables on a single page in a PDF document).
  • The STARTPAGE= option in the ODS PDF statement. Refer to Sample 48569 for sample code that demonstrates how to put multiple graphs on a single PDF page using the STARTPAGE= option.
One common use for PROC GREPLAY is to delete graphs that exist in a SAS/GRAPH catalog. Refer to SAS Note 38183 for information about using PROC GREPLAY to delete graphs in a graphics catalog.

The main use for PROC GREPLAY is to put multiple graphs on a single page. As long as you are placing fewer than five graphs on the same page, you can use a predefined GREPLAY template to accomplish this. The following sample programs demonstrate this technique:

  • Sample 44955: Use PROC GREPLAY with the ODS PDF statement to place four graphs on the same page.
  • Sample 45147: Use PROC GREPLAY to place four graphs on a single page in an RTF document.
If you want to put more than four graphs on a page, you need to use the TDEF statement within PROC GREPLAY to create a custom GREPLAY template. The following sample programs demonstrate this:
  • Sample 44973: Use PROC GREPLAY to place six graphs on a single page in a PDF document.
  • Sample 45150: Use PROC GREPLAY to place six graphs on a single page in an RTF document.
If you want to put multiple graphs on a page that has a common title at the top of the page and a common footnote at the bottom of the page, refer to Sample 25590.

Among the default GREPLAY templates is a template called WHOLE. This template is useful for overlaying multiple graphs or creating unique graphs, such as the broken axis panel graph that Sample 48333 creates.

The ODS Statistical Graphics (SG) procedures such as SGPLOT and the SAS/STAT® procedures with ODS Graphics enabled do not write graph entries to a catalog. Therefore, you cannot use PROC GREPLAY to directly replay graphics output that the SG procedures and ODS Graphics creates. However, you might want to use PROC GREPLAY with SG procedure and ODS Graphics output when putting multiple SG procedure and ODS Graphics graphs on the same page, or when combining SG procedure output and ODS Graphics output on the same page with regular SAS/GRAPH procedure output.

To use the GREPLAY procedure with SG procedure output and ODS Graphics output, use the three-step process that Sample 41461 demonstrates.

When using multiple SAS/GRAPH procedures to write graphics output to a PDF file, the table of contents in the PDF file can get very busy and complex. Sample 48546 demonstrates how to use PROC GREPLAY to simplify the table of contents when writing multiple graphs to a PDF file.

Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemSAS/GRAPHz/OS9.1 TS1M3 SP4
Microsoft® Windows® for 64-Bit Itanium-based Systems9.1 TS1M3 SP4
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.1 TS1M3 SP4
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.1 TS1M3 SP4
Microsoft Windows XP 64-bit Edition9.1 TS1M3 SP4
Microsoft Windows 2000 Advanced Server9.1 TS1M3 SP4
Microsoft Windows 2000 Datacenter Server9.1 TS1M3 SP4
Microsoft Windows 2000 Server9.1 TS1M3 SP4
Microsoft Windows 2000 Professional9.1 TS1M3 SP4
Microsoft Windows NT Workstation9.1 TS1M3 SP4
Microsoft Windows Server 2003 Datacenter Edition9.1 TS1M3 SP4
Microsoft Windows Server 2003 Enterprise Edition9.1 TS1M3 SP4
Microsoft Windows Server 2003 Standard Edition9.1 TS1M3 SP4
Microsoft Windows XP Professional9.1 TS1M3 SP4
Windows Vista9.1 TS1M3 SP4
Windows Vista for x649.1 TS1M3 SP4
64-bit Enabled AIX9.1 TS1M3 SP4
64-bit Enabled HP-UX9.1 TS1M3 SP4
64-bit Enabled Solaris9.1 TS1M3 SP4
HP-UX IPF9.1 TS1M3 SP4
Linux9.1 TS1M3 SP4
Linux on Itanium9.1 TS1M3 SP4
OpenVMS Alpha9.1 TS1M3 SP4
Solaris for x649.1 TS1M3 SP4
Tru64 UNIX9.1 TS1M3 SP4
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.