Study guide
9.1 Output Delivery System (ODS) Architecture Basics
SAS Certified Specialist: Base Programming Using SAS 9.4 A00-231
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: SAS Base Programming Exam Overview
1.1 A00-231 Exam Format, Scoring & Test-Day Logistics 1.2 Official Content Areas, Weights & Study Plan
2 Chapter 2: Accessing & Creating SAS Data Structures
2.1 SAS Environment, Syntax Rules, & Data Step Basics 2.2 SAS Data Libraries & the LIBNAME Statement 2.3 Investigating Libraries with PROC CONTENTS & PROC DATASETS 2.4 Importing Delimited & Excel Data with PROC IMPORT 2.5 Raw Data Ingestion with INFILE and INPUT Statements
3 Chapter 3: Managing & Combining SAS Data Sets
3.1 Reading SAS Data Sets with the SET Statement 3.2 Combining Data Sets: Concatenating & Interleaving 3.3 Match-Merging with BY Statements & FIRST./LAST. Processing 3.4 Controlling Data Output & Variable Selection (KEEP, DROP, RENAME, OBS=)
4 Chapter 4: Data Transformation & Conditional Logic
4.1 Creating & Modifying Variables with Assignment Statements 4.2 Modifying Variable Attributes with LENGTH, LABEL, FORMAT & RENAME= 4.3 Conditional Processing: IF-THEN/ELSE Statements & WHERE Subsetting 4.4 Accumulating Totals & Subtotals (RETAIN & Sum Statement) 4.5 Processing Data Iteratively with DO Loops
5 Chapter 5: SAS Functions & Data Type Conversions
5.1 Character Functions for String Manipulation 5.2 Numeric & Mathematical Functions 5.3 Working with SAS Dates, Times, & Intervals 5.4 Reading & Displaying Dates with Informats and Formats 5.5 Explicit & Implicit Data Type Conversions (INPUT & PUT)
6 Chapter 6: Restructuring Data & Program Maintenance
6.1 SAS Array Processing for Multi-Variable Transformations 6.2 Sorting Data Sets with PROC SORT 6.3 Restructuring Data Sets with PROC TRANSPOSE 6.4 Creating & Applying Custom Formats with PROC FORMAT 6.5 Simplifying Programs with Macro Variables (%LET)
7 Chapter 7: Error Handling & Debugging SAS Programs
7.1 SAS Log Analysis & Diagnostic Messages 7.2 Syntax vs. Logic Errors & Phasing 7.3 Debugging Techniques with _ERROR_, _N_, & PUT Statements 7.4 Identifying Logic Errors with the PUTLOG Statement 7.5 Handling Missing Values & Preventing Calculation Propagations
8 Chapter 8: Summary & Detail Data Reporting
8.1 Detail Reporting with PROC PRINT 8.2 Descriptive Statistics with PROC MEANS & PROC SUMMARY 8.3 Frequency & Categorical Analysis with PROC FREQ 8.4 Screening Extreme & Missing Values with PROC UNIVARIATE 8.5 Custom Tabular Reports with PROC REPORT & PROC TABULATE
9 Chapter 9: ODS Output Delivery & Data Export
9.1 Output Delivery System (ODS) Architecture Basics 9.2 Generating PDF, HTML, & RTF Output Destinations 9.3 Exporting Reports to Excel with ODS EXCEL & XLSX 9.4 Generating CSV, PowerPoint & Other ODS Destinations 9.5 Customizing ODS Titles, Footnotes, & Global Options 9.6 Exporting SAS Data Sets with PROC EXPORT & the XLSX Engine
9.1 Output Delivery System (ODS) Architecture Basics
Key Takeaways Explain This Topic AI
ODS decouples procedure output generation into two separate entities: a Data Component (unformatted raw results) and a Table Definition / Template (formatting rules).
The combination of a Data Component and a Table Definition creates an Output Object, which ODS then formats for one or more output destinations simultaneously.
The ODS TRACE ON statement writes detailed metadata about output objects (Name, Label, Template, and Path) directly to the SAS log.
ODS SELECT and ODS EXCLUDE statements filter which output objects are sent to open destinations, accepting single names, lists, or wildcard specifications.
The ODS OUTPUT statement captures any ODS output object and saves it as a standard, reusable SAS data set for further data step processing or reporting.
Last updated: August 2026
9.1 Output Delivery System (ODS) Architecture Basics
Prior to SAS Version 7, SAS procedure output was tightly coupled to rigid, monospaced text destinations—primarily the traditional SAS procedure output file known as the LISTING destination. If a programmer needed to extract a single calculated statistic (such as a p-value, a mean, or a parameter estimate) from a procedure, they had to resort to parsing text files with complex column offset logic or relying on limited OUT= data set options provided by specific procedures.
The introduction of the Output Delivery System (ODS) completely revolutionized how SAS processes and formats output. ODS decouples data generation from report presentation. Rather than hardcoding formatted text directly into an output file, SAS procedures now produce structured, unformatted data components that ODS transforms into handsome reports across dozens of modern file formats.
The ODS Component Architecture
To master ODS for the SAS Base Programming exam, you must understand the two core components that unite to produce output:
Data Component : The raw, unformatted data values produced by a SAS DATA step or PROC step during execution. The data component contains pure numbers, characters, and structural metrics without font sizes, colors, or page layout rules.
Table Definition (Template) : A blueprint or set of formatting instructions created using PROC TEMPLATE . It defines column headers, data alignment, numeric formats, font styles, colors, and border styles.
When a SAS procedure runs under ODS, it combines the Data Component and the Table Definition to form an Output Object . Data Component + Table Definition = Output Object \text{Data Component} + \text{Table Definition} = \text{Output Object} Data Component + Table Definition = Output Object +------------------------+ +-------------------------+
- | Data Component | + | Table Definition |
- | (Raw Unformatted Data) | | (PROC TEMPLATE Blueprint)|
- +------------------------+ +-------------------------+
- \ /
- \ /
- v v
- +--------------------------+
- | Output Object |
- | (Named SAS Report Element)|
- +--------------------------+
- |
- +----------------+----------------+
- | | |
- v v v
- +-----------+ +-----------+ +-----------+
- | HTML | | PDF | | EXCEL |
- +-----------+ +-----------+ +-----------+
Once an Output Object is created in memory, ODS can route it to one or more destinations simultaneously—such as HTML, PDF, RTF, EXCEL, or a SAS Data Set—without re-running the underlying procedure.
Discovering Output Objects with ODS TRACE
Every SAS procedure generates one or more distinct output objects. For example, PROC MEANS produces output objects for summary statistics, while PROC UNIVARIATE produces multiple objects including Moments , BasicMeasures , TestsForLocation , Quantiles , and ExtremeObs .
To determine the exact names of output objects generated by a procedure, use the ODS TRACE statement.
- Syntax for ODS TRACE ODS TRACE ON </ LISTING>;
- /* SAS Procedure Code Here */
- ODS TRACE OFF;
When ODS TRACE ON; is executed, SAS writes a trace record to the SAS Log for every output object created by subsequent procedure steps.
Example: Tracing PROC UNIVARIATE ods trace on;
- proc univariate data=sashelp.class;
- var Height;
- run;
ods trace off;
SAS Log Trace Output Sample Output Added:
- ------------
- Name: Moments
- Label: Moments
- Template: base.univariate.Moments
- Path: Univariate.Height.Moments
- ------------
Output Added:
- ------------
- Name: BasicMeasures
- Label: Basic Measures
- Template: base.univariate.Measures
- Path: Univariate.Height.BasicMeasures
- ------------
Output Added:
- ------------
- Name: Quantiles
- Label: Quantiles
- Template: base.univariate.Quantiles
- Path: Univariate.Height.Quantiles
- ------------
- Key Trace Fields to Know for the Exam
Trace Field Description Exam Relevance
Name The unique identifier of the output object (e.g., Quantiles , ExtremeObs ). Used in ODS SELECT , ODS EXCLUDE , and ODS OUTPUT statements.
Label A descriptive human-readable title for the output object (e.g., Basic Measures ). Can also be referenced in selection/exclusion lists.
Template The name of the PROC TEMPLATE definition used to format the object. Identifies the default visual blueprint.
Path The full hierarchical path of the object (e.g., Univariate.Height.Moments ). Useful when multiple variables generate identical object names.
Tip
ODS TRACE ON; remains active across subsequent step boundaries until explicitly turned off with ODS TRACE OFF; . Always turn off tracing when debugging is complete to avoid cluttering the SAS Log.
Filtering Output Objects with ODS SELECT and ODS EXCLUDE
By default, ODS sends all output objects generated by a procedure to all currently open destinations. However, you can precisely control which objects appear in your reports using the ODS SELECT and ODS EXCLUDE statements.
1. The ODS SELECT Statement
The ODS SELECT statement specifies that only the listed output objects should be delivered to open ODS destinations. All unlisted objects are discarded. /* Deliver ONLY the Moments and Quantiles objects */
ods select Moments Quantiles;
- proc univariate data=sashelp.class;
- var Weight;
- run;
- 2. The ODS EXCLUDE Statement
The ODS EXCLUDE statement specifies that the listed output objects should be suppressed. All unlisted objects are delivered to open destinations. /* Suppress ExtremeObs and TestsForLocation */
ods exclude ExtremeObs TestsForLocation;
- proc univariate data=sashelp.class;
- var Weight;
- run;
- 3. Resetting Selection and Exclusion Filters
ODS selection and exclusion lists persist across procedure steps. To restore default behavior where all output objects are sent to open destinations, use ODS SELECT ALL; or ODS EXCLUDE NONE; . /* Reset ODS filters to default */
- ods select all;
- /* OR */
- ods exclude none;
- ODS Filtering Rules Summary Table
Statement Syntax Effect on Output Objects Persistence
ODS SELECT object-list; Keeps only specified objects; suppresses all others. Persists until changed or reset.
ODS EXCLUDE object-list; Suppresses specified objects; keeps all others. Persists until changed or reset.
ODS SELECT ALL; Resets selection filter to deliver all generated objects. Cancels prior ODS SELECT / EXCLUDE .
ODS EXCLUDE NONE; Resets exclusion filter to deliver all generated objects. Cancels prior ODS SELECT / EXCLUDE .
Capturing Output into Data Sets with ODS OUTPUT
One of the most powerful features of ODS architecture is the ODS OUTPUT statement. It allows you to intercept any ODS output object and convert it into a standard SAS data set.
Unlike older SAS procedure OUT= data set options (which were limited to specific procedures and fixed structures), ODS OUTPUT works with any ODS output object from any SAS procedure.
- Syntax for ODS OUTPUT ODS OUTPUT output-object-name = new-sas-data-set <(data-set-options)>;
- Practical Example: Converting PROC MEANS Output into a SAS Data Set
Suppose you want to extract summary statistics from PROC MEANS and store them in a SAS data set named ClassSummary for subsequent processing. /* Step 1: Trace or identify object name (PROC MEANS default summary is Summary) */
ods output Summary = work.ClassSummary;
- proc means data=sashelp.class mean std min max;
- var Age Height Weight;
- class Sex;
- run;
- /* Step 2: Print the captured SAS Data Set */
- proc print data=work.ClassSummary;
- title "Summary Statistics Captured via ODS OUTPUT";
- run;
- Multiple Object Capture
- You can capture multiple objects in a single ODS OUTPUT statement: ods output Moments = work.HeightMoments
- Quantiles = work.HeightQuantiles;
- proc univariate data=sashelp.class;
- var Height;
- run;
Important
The ODS OUTPUT statement is an environment control statement. It must be placed before or within the procedure step that generates the output object. The resulting SAS data set is closed and written when the procedure step terminates.