9.4 Generating CSV, PowerPoint & Other ODS Destinations

Key Takeaways

  • The content guide requires HTML, PDF, RTF, XLSX, and PPTX files plus comma-separated value files from ODS statements.
  • ODS CSV writes procedure output as comma-separated text; ODS CSVALL adds titles, footnotes, and by-line rows that ODS CSV omits.
  • ODS POWERPOINT produces a native .pptx deck in which each procedure output becomes a slide, and LAYOUT= controls the slide template.
  • STYLE= applies a style template on any destination opening statement, and STARTPAGE= controls where new pages or slides begin.
  • ODS CSV is a reporting destination while PROC EXPORT is a data-transfer utility, so ODS CSV honours formats, labels, and titles that PROC EXPORT ignores.
Last updated: August 2026

9.4 Generating CSV, PowerPoint & Other ODS Destinations

Quick Answer: The content guide's ODS objective asks for four things: identify the Output Delivery System destinations, create HTML, PDF, RTF, XLSX, and PPTX files with ODS statements, use the STYLE= option to specify a style template, and generate comma-separated value (CSV) files with ODS statements. HTML, PDF, RTF, and XLSX are covered in the preceding sections; this section closes out CSV and PPTX and the options that apply across every destination.


1. ODS CSV: Procedure Output as Comma-Separated Text

ods csv file="C:\reports\region_summary.csv";

proc means data=sashelp.shoes mean sum maxdec=2;
   class Region;
   var Sales;
run;

ods csv close;

ODS CSV takes the rendered report — the same table PROC MEANS would print — and writes it as comma-separated text. Because it is a reporting destination rather than a data-transfer utility, it honours everything the report honours: column labels, applied formats, computed statistic columns, and the column order the procedure chose.

ODS CSV versus ODS CSVALL

DestinationWhat it writes
ODS CSVThe table only — the column headings row plus data rows
ODS CSVALLThe table plus titles, footnotes, by-lines, and blank separator rows
ods csvall file="C:\reports\annotated_summary.csv";

title "Regional Sales Summary";
footnote "Source: SASHELP.SHOES";

proc means data=sashelp.shoes mean sum maxdec=2;
   class Region;
   var Sales;
run;

ods csvall close;
footnote;

Use CSV when another program will parse the file, because leading title rows break most parsers. Use CSVALL when a human will open it and needs the context.

Two Ways to Get a CSV, and When Each Is Right

RequirementCorrect tool
A CSV of a procedure's report, with labels, formats, and computed statisticsODS CSV
A CSV of a data set's raw rows, one row per observationPROC EXPORT ... DBMS=CSV
A CSV whose exact layout you control line by lineDATA _NULL_ with FILE and PUT

Exam Trap: ODS CSV writes what the procedure displayed. Point it at a PROC MEANS step and you get the summary statistics, not the underlying observations. When a question asks for a comma-delimited copy of a data set, PROC EXPORT is the answer; when it asks for a comma-delimited copy of a report, ODS CSV is.


2. ODS POWERPOINT: Native .pptx Decks

ods powerpoint file="C:\reports\quarterly_review.pptx"
               style=PowerPointLight;

title "Q1 Sales by Region";
proc means data=sashelp.shoes mean sum maxdec=2;
   class Region;
   var Sales;
run;

title "Q1 Product Mix";
proc freq data=sashelp.shoes;
   tables Product / nocum;
run;

ods powerpoint close;

Each procedure output becomes a slide, with the active TITLE used as the slide title. The result is a genuine OpenXML .pptx file that opens natively in PowerPoint — no image capture, no manual pasting.

Controlling Slide Layout

ods powerpoint file="C:\reports\deck.pptx"
               layout=titleandcontent
               style=PowerPointDark;
LAYOUT= valueSlide template produced
TITLEANDCONTENT (default)Title bar plus a single content region
TITLEONLYTitle bar only, useful for section dividers
CONTENTContent region with no title bar
TWOCONTENTTwo side-by-side content regions

STARTPAGE= behaves on ODS POWERPOINT the way it does on ODS PDF: STARTPAGE=NO keeps consecutive procedure outputs on the same slide, and STARTPAGE=NOW forces a break immediately.

ods powerpoint file="C:\reports\compact.pptx" startpage=no;
   proc print data=sashelp.class(obs=5) noobs; run;
   proc means data=sashelp.class mean; var Height; run;   /* same slide */
ods powerpoint close;

3. Style Templates Apply Everywhere

STYLE= is accepted on the opening statement of essentially every destination, so one option controls fonts, colours, borders, and cell padding across the whole document.

ods pdf        file="report.pdf"    style=Pearl;
ods rtf        file="report.rtf"    style=Journal;
ods excel      file="report.xlsx"   style=Excel;
ods powerpoint file="report.pptx"   style=PowerPointDark;
ods csv        file="report.csv";   /* CSV is plain text - STYLE= has no visual effect */

ODS CSV accepts the option without complaint but produces plain text, so a style template has nothing to act on. That asymmetry is a favourite distractor.


4. Opening Several Destinations at Once

ODS routes each output object to every open destination simultaneously. One execution of a procedure can therefore populate four files.

ods listing close;                                   /* skip redundant text rendering */
ods pdf        file="C:\out\summary.pdf"   style=Pearl;
ods excel      file="C:\out\summary.xlsx"  style=Excel;
ods powerpoint file="C:\out\summary.pptx"  style=PowerPointLight;
ods csv        file="C:\out\summary.csv";

title "Regional Sales Summary";
proc means data=sashelp.shoes mean sum maxdec=2;
   class Region;
   var Sales;
run;

ods _all_ close;    /* closes every open destination in one statement */
ods listing;        /* restore the default for interactive work       */

ODS _ALL_ CLOSE; is the safety net at the end of a batch program: it releases every file lock without your having to remember which destinations were opened.


5. Destination Summary

DestinationFile producedHonours styles?Typical use
ODS HTML.htmlYesWeb and screen viewing
ODS PDF.pdfYesPrinting, archiving, distribution
ODS RTF.rtfYesEditable Microsoft Word documents
ODS EXCEL.xlsxYesFormatted multi-tab spreadsheets
ODS POWERPOINT.pptxYesSlide decks, one slide per output object
ODS CSV / CSVALL.csvNoMachine-readable comma-delimited report text
ODS LISTINGTextNoLegacy monospaced output
ODS OUTPUTSAS data setn/aCapturing any output object as data
Test Your Knowledge

Which ODS destination writes procedure output as comma-separated text including the titles and footnotes?

A
B
C
D
Test Your Knowledge

A programmer must deliver a native PowerPoint file in which each procedure's output appears on its own slide. Which statement opens the correct destination?

A
B
C
D
Test Your Knowledge

A request asks for a comma-delimited file containing every observation of WORK.CUSTOMERS, one row per customer. Which tool is correct and why?

A
B
C
D
Test Your Knowledge

What does ODS _ALL_ CLOSE; accomplish at the end of a batch program?

A
B
C
D