Building Business Intelligence Reports with SAS ODS
Raw SAS output printed to the Results window served analysts well in the era of internal reports reviewed only by statisticians. Today, business stakeholders expect polished, formatted reports delivered as PDFs, interactive HTML pages, or Excel workbooks they can pivot themselves. The SAS Output Delivery System — ODS — handles all of this, turning the output of any SAS procedure into a professional document with minimal extra code.
Understanding ODS Destinations
An ODS destination is simply the format ODS writes to. The most commonly used destinations are ODS HTML5 for browser-based output, ODS PDF for print-ready documents, ODS EXCEL for spreadsheets, and ODS RTF for Word-compatible files. You open a destination, run your procedures, then close the destination. All output generated between open and close goes to that destination. Multiple destinations can be open simultaneously, so a single PROC run can produce an HTML report and a PDF simultaneously, saving computation time on expensive procedures run against large datasets.
Customizing Appearance with Style Templates
ODS ships with dozens of built-in style templates — HTMLBLUE, JOURNAL, MINIMAL, STATISTICAL — each applying a consistent color scheme, font set, and cell formatting to every table and graph. Specify a style with the STYLE= option on the ODS destination statement. For corporate reports requiring exact brand colors and fonts, PROC TEMPLATE lets you define custom styles that inherit from a base template and override only the properties you need. Creating a company-branded ODS style once and distributing it as a compiled template catalog means every analyst on your team produces visually consistent output without individual formatting work.
Combining Tables and Graphics in One Report
ODS treats both PROC output tables and SG-family graph output as objects it can route together. Open an ODS HTML5 destination, run a PROC FREQ for a frequency table, then run a PROC SGPLOT for a bar chart, and both appear in the same HTML file in sequence. The ODS LAYOUT system — specifically ODS LAYOUT GRIDDED — lets you place tables and graphs side by side in a grid layout, producing the kind of dashboard-style single-page summaries executives favor. Pair this with ODS NOPROCTITLE to suppress procedure-name headers that look unprofessional in stakeholder-facing documents.
Automating Report Distribution
Generating a beautiful report is only half the job — it must reach its audience reliably. SAS can invoke operating system commands via X statements or the PIPE fileref, enabling automatic email distribution of finished report files using command-line mail utilities. Combine this with scheduled SAS batch jobs run by a job scheduler and you have a fully automated reporting pipeline: data refreshes on schedule, SAS processes it, ODS renders the report, and the scheduler distributes it — all without human intervention. This frees analysts to focus on interpretation and strategic analysis rather than mechanical production work. Learn more at SASBase or reach out to our team.