The ODS Destination for PowerPoint Has a New Option

Have you heard? The ODS Destination for PowerPoint Has a New Option

It’s true. The ODS destination for PowerPoint now has the STARTPAGE= option, which provides you with greater control and flexibility when creating presentations.

Added to the ODS POWERPOINT statement in SAS® 9.4TS1M4, the STARTPAGE= option enables you to force the creation of a new slide between procedures and between ODS layout containers. Inserting a slide break between layout containers is one of the most impactful ways that you can use this option.

A new layout container does not automatically trigger a new slide within the presentation. A new slide is started when the current slide is full. That is the default, but the new STARTPAGE= option gives you the ability to start a new slide between containers even if the current slide is not full.

Examples

Shown below are four procedures placed within three layout containers.

The first PROC ODSTEXT step is placed in the first layout container. Its purpose is to generate a slide of text, with that text roughly centered in the slide.

The second PROC ODSTEXT step is in the second container. Its purpose is to provide useful information about the table and graph.

The PROC TABULATE and SGPLOT steps make up the third container. They are the results of the analysis and, as such, need to be displayed side by side.

Default Behavior of ODS POWERPOINT, Without STARTPAGE=

Let’s look at the default behavior. In this example, the STARTPAGE= option is not used.

ods powerpoint file='example1.pptx' options(backgroundimage="saslogo_pptx.png");
title;
ods layout gridded x=10% y=25%;
proc odstext;
p "Have you heard?" /style=[just=c fontsize=42pt color=RoyalBlue];
p "The STARTPAGE= option has been added to the ODS POWERPOINT statement!" /style=[just=c fontsize=24pt];
run;
ods layout end;

ods layout gridded rows=1 columns=1;
ods region;
proc odstext;
p 'Table Shows Total Runs and Hits for Each League';
p 'The Graph Contains One Bubble for Each Player. The Size of Each Bubble Represents the Magnitude of the RBIs.';
run;
ods layout end;

ods graphics / width=4.5in height=4in;
ods layout gridded columns=2 column_widths=(47% 47%) column_gutter=1pct;
ods region;
proc tabulate data=sashelp.baseball;
class league;
var nruns nhits nrbi;
tables league='', sum='Totals'*(nruns nhits)*f=comma12.;
run;

ods region;
proc sgplot data=sashelp.baseball;
bubble x=nhits y=nruns size=nrbi/ group=league transparency=.3;
run;
ods layout end;
ods powerpoint close;

Here is the resulting slide output:

Those results are not what we hoped they would be. The output from the second PROC ODSTEXT step, which is to provide information about the table and graph, is on the first slide. So is the graph!!! And the graph does not look good because it is the wrong size. The table is by itself on the second slide. This is not the desired output at all.

Here Is Where STARTPAGE= Helps!

In this example, an ODS POWERPOINT statement with the STARTPAGE= option is added. It is placed after the ODS LAYOUT END statement for the first container.

ods powerpoint file='example2.pptx' options(backgroundimage="saslogo_pptx.png");
title;
ods layout gridded x=10% y=25%;
proc odstext;
p "Have you heard?" /style=[just=c fontsize=42pt color=RoyalBlue];
p "The STARTPAGE= option has been added to the ODS POWERPOINT statement!" /style=[just=c fontsize=24pt];
run;
ods layout end;

ods powerpoint startpage=now; /* <---- Triggers a new slide */

ods layout gridded rows=1 columns=1;
ods region;
proc odstext;
p 'Table Shows Total Runs and Hits for Each League';
p 'The Graph Contains One Bubble for Each Player. The Size of Each Bubble Represents the Magnitude of the RBIs.';
run;
ods layout end;

ods graphics / width=4.5in height=4in;
ods layout gridded columns=2 column_widths=(47% 47%) column_gutter=1pct;
ods region;
proc tabulate data=sashelp.baseball;
class league;
var nruns nhits nrbi;
tables league='', sum='Totals'*(nruns nhits)*f=comma12.;
run;

ods region;
proc sgplot data=sashelp.baseball;
bubble x=nhits y=nruns size=nrbi/ group=league transparency=.3;
run;
ods layout end;
ods powerpoint close;

The STARTPAGE= option gave us exactly what we need. The first slide contains just the text (from the first layout container). The second slide contains more text along with the table and graph (from the second and third layout containers).

Use It Wisely!

The most important thing to know about using the STARTPAGE= option with layout containers is that it has to be placed between containers. It cannot be placed within a container. So you cannot put the statement between the ODS LAYOUT GRIDDED and ODS LAYOUT END statements.

For more information about ODS destination for PowerPoint and all of its options, visit this ODS POWERPOINT Statement page in the SAS® 9.4 Output Delivery System: User’s Guide, Fifth Edition.

Note: The portion of the example that uses the SASHELP.BASEBALL data set was taken from the SAS Global Forum 2016 paper, The Dynamic Duo: ODS Layout and the ODS Destination for PowerPoint. Take a peek at it for more examples of using ODS Layout with the ODS destination for PowerPoint.

The ODS Destination for PowerPoint Has a New Option was published on SAS Users.