Sample 51229: Use the GREPLAY procedure together with the ODS Destination for PowerPoint to display multiple graphs in a single slide
Beginning with SAS® 9.4, the new ODS Destination for PowerPoint creates native PowerPoint documents. The sample code on the
Full Code tab demonstrates how to use the GPLOT procedure followed by the GREPLAY procedure to display two graphs in a single slide when using the ODS POWERPOINT statement.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
You must run this code using SAS 9.4 since the ODS POWERPOINT statement is new beginning with this release.
/* This macro code deletes any old graphs */
/* in the WORK.GSEG graphics catalog. */
%macro delcat(catname);
%if %sysfunc(cexist(&catname))
%then %do;
proc greplay nofs igout=&catname;
delete _all_;
run;
quit;
%end;
%mend delcat;
%delcat(work.gseg)
ods _all_ close;
ods listing;
/* This code writes two GPLOT graphs to the */
/* default graphics catalog of WORK.GSEG. */
goptions reset=all device=png300 vsize=3in nodisplay;
symbol1 interpol=none value=dot color=cx7c95ca height=2.5;
axis1 label=(angle=90) order=(0 to 70 by 10) minor=none;
axis2 minor=none;
title1 'City MPG';
proc gplot data=sashelp.cars;
plot mpg_city*horsepower / vaxis=axis1 haxis=axis2;
run;
quit;
symbol1 interpol=none value=dot color=cxde7e6f height=2.5;
title1 'Highway MPG';
proc gplot data=sashelp.cars;
plot mpg_highway*horsepower / vaxis=axis1 haxis=axis2;
run;
quit;
goptions reset=all device=png300;
/* This section of code uses the ODS Destination for */
/* PowerPoint togther with PROC GREPLAY to display the */
/* two graphs created above in a single slide. */
ods _all_ close;
ods powerpoint file='greplay.pptx' image_dpi=300;
proc greplay igout=work.gseg nofs tc=sashelp.templt template=v2;
treplay 1:1 2:2;
run;
quit;
ods powerpoint close;
ods listing;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample illustrates how to use the GREPLAY procedure together with the ODS Destination for PowerPoint to display multiple graphs in a single slide.
Date Modified: | 2013-10-08 15:52:27 |
Date Created: | 2013-10-02 13:32:05 |
Operating System and Release Information
SAS System | N/A | 64-bit Enabled AIX | 9.4 TS1M0 | |
Teradata on Linux | 9.4 TS1M0 | |
z/OS | 9.4 TS1M0 | |
Z64 | 9.4 TS1M0 | |
Apple Mobile Operating System | 9.4 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.4 TS1M0 | |
Microsoft® Windows® for x64 | 9.4 TS1M0 | |
Microsoft Windows 8 Enterprise 32-bit | 9.4 TS1M0 | |
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M0 | |
Microsoft Windows 8 Pro 32-bit | 9.4 TS1M0 | |
Microsoft Windows 8 Pro x64 | 9.4 TS1M0 | |
Microsoft Windows Server 2008 R2 | 9.4 TS1M0 | |
Microsoft Windows Server 2008 for x64 | 9.4 TS1M0 | |
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M0 | |
Microsoft Windows Server 2012 Std | 9.4 TS1M0 | |
Netezza TwinFin 32-bit SMP Hosts | 9.4 TS1M0 | |
DB2 Universal Database on Linux x64 | 9.4 TS1M0 | |
DB2 Universal Database on AIX | 9.4 TS1M0 | |
Greenplum on Linux x64 | 9.4 TS1M0 | |
Netezza TwinFin 32bit blade | 9.4 TS1M0 | |
Windows 7 Professional x64 | 9.4 TS1M0 | |
Windows 7 Enterprise x64 | 9.4 TS1M0 | |
64-bit Enabled HP-UX | 9.4 TS1M0 | |
64-bit Enabled Solaris | 9.4 TS1M0 | |
HP-UX IPF | 9.4 TS1M0 | |
Linux | 9.4 TS1M0 | |
Linux for x64 | 9.4 TS1M0 | |
Solaris for x64 | 9.4 TS1M0 | |