I have code that generates a lot of performance data combining SMF/RMF (mainframe performance) with information on my firm's disk subsystems. What is attached is a small part of what will exist. I'm looking to produce a single-run that creates a PowerPoint that is going to be hundreds of slides. The code includes a lot of PROC FREQs that generate multiple pages of print, and also a lot of SGPLOT output.
I'm concerned that with PROC FREQ and ODS POWERPOINT I can't seem to set a number of lines of data for each PowerPoint slide, it seems to be trying to write more lines than can fit on a single slide.and I see a lot of text well outside the borders of the slide. With one example PROC FREQ in this code, doing a TABLE MARSSN * MARSCU, there might be as many as 10 subsystems (identified by serial number in MARSSN) and within each theoretically as many as 256 control units (MARSCU)) and that frequency table could be dozens of pages.
ODS seems to be very powerful but complicated. I really don't want to have to write a thousand lines of code for ODS templates for an eight-line proc.
Can anyone suggest a way of limiting the number of lines of PROC FREQ output per slide? I thought maybe an OPTIONS PAGESIZE=10 or something at the start might work but I'm not sure it does. My test data isn't sufficient to generate a multi-page output from these procs.
A minor issue is coming up. I have used "ODS NOPROCTITLE" but that doesn't seem to stop the slides from having a PROC FREQ generated "The FREQ Procedure" title on the slides.
Hi:
@Reeza's right, PROC REPORT may be part of your solution. However, PowerPoint by itself (without SAS in the mix) can be very picky about what fits on a slide depending on the slide design settings and the size of the text to go on the slide.
When you put ODS PowerPoint into the mix, you can easily generate a table that won't fit on one slide by just using a default PowerPoint design with a huge (36pt) font. PROC REPORT or PROC TABULATE are nicer than PROC FREQ because you can control the fonts from within the procedure. Same with SGPLOT. You sort of have to fiddle with everything to see what fits and then change fonts accordingly. Usually with BY group processing you can force a new slide for every BY group. That may or may not fit this scenario.
When I run this test with SASHELP.SHOES, the output from PROC FREQ is huge and spans multiple slides.
ods powerpoint file='c:\temp\testsmall.pptx';
proc freq data=sashelp.shoes;
tables region*product / nocum nopercent norow nocol;
run;
proc report data=sashelp.shoes
style(header)={fontsize=8pt}
style(column)={fontsize=8pt};
column ('Region' region) product,n ('Total' n=tot);
define region / group ' ';
define product/ across 'Table of Region by Product';
define n/ ' ';
define tot / ' ';
rbreak after / summarize;
compute after;
region = 'Total';
endcomp;
run;
run;
ods powerpoint close;
On the other hand, when I switch to PROC REPORT and change the fontsize to 8pt, the whole table fits, but if you run this you will see that there's not much room for more products or more regions on the slide.
Cynthia
Interesting question. I've moved your question to the ODS reporting forum instead, as that's more appropriate.
I don't know the answer, but suspect a suggested workaround would involve PROC REPORT which would allow you some more functionality around the number of rows per page using some COMPUTE blocks.
Example:
Hi:
@Reeza's right, PROC REPORT may be part of your solution. However, PowerPoint by itself (without SAS in the mix) can be very picky about what fits on a slide depending on the slide design settings and the size of the text to go on the slide.
When you put ODS PowerPoint into the mix, you can easily generate a table that won't fit on one slide by just using a default PowerPoint design with a huge (36pt) font. PROC REPORT or PROC TABULATE are nicer than PROC FREQ because you can control the fonts from within the procedure. Same with SGPLOT. You sort of have to fiddle with everything to see what fits and then change fonts accordingly. Usually with BY group processing you can force a new slide for every BY group. That may or may not fit this scenario.
When I run this test with SASHELP.SHOES, the output from PROC FREQ is huge and spans multiple slides.
ods powerpoint file='c:\temp\testsmall.pptx';
proc freq data=sashelp.shoes;
tables region*product / nocum nopercent norow nocol;
run;
proc report data=sashelp.shoes
style(header)={fontsize=8pt}
style(column)={fontsize=8pt};
column ('Region' region) product,n ('Total' n=tot);
define region / group ' ';
define product/ across 'Table of Region by Product';
define n/ ' ';
define tot / ' ';
rbreak after / summarize;
compute after;
region = 'Total';
endcomp;
run;
run;
ods powerpoint close;
On the other hand, when I switch to PROC REPORT and change the fontsize to 8pt, the whole table fits, but if you run this you will see that there's not much room for more products or more regions on the slide.
Cynthia
Thanks.
I've never used PROC REPORT but will look at it.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.