Study guide

9.6 Exporting SAS Data Sets with PROC EXPORT & the XLSX Engine

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.6 Exporting SAS Data Sets with PROC EXPORT & the XLSX Engine

Key Takeaways Explain This Topic AI

PROC EXPORT writes a SAS data set to an external file and is the DATA-step-free alternative for producing raw data files.

The DBMS= identifier selects the output format: CSV, TAB, DLM, JMP, and XLSX are the ones the content guide names.

OUTFILE= names a physical file for delimited output while OUTTABLE= names a table inside a database or workbook.

PUTNAMES=YES, the default, writes variable names as the first row; LABEL writes labels instead.

The SAS/ACCESS XLSX engine assigned with LIBNAME lets a DATA step write worksheets directly, which is faster than PROC EXPORT when several sheets are involved.

Last updated: August 2026

9.6 Exporting SAS Data Sets with PROC EXPORT & the XLSX Engine

Quick Answer: The final objective in the Generate Reports and Output area is Export data , with two expanded bullets: create a simple raw data file using PROC EXPORT as an alternative to the DATA step (controlling the format with the DBMS identifiers csv, jmp, tab, dlm ), and export data to Microsoft Excel using the SAS/ACCESS XLSX engine .

PROC IMPORT reads external files in; PROC EXPORT writes SAS data sets out. Both infer as much as they can so that you never write an INPUT or PUT statement.

  • 1. PROC EXPORT Syntax PROC EXPORT DATA = libref.SAS-data-set <(data-set-options)>
  • OUTFILE = "physical-file-path" /* for delimited/raw files */
  • | OUTTABLE = "table-name" /* for database/workbook tables */
  • DBMS = identifier
  • <REPLACE>;
  • <PUTNAMES = YES | NO;>
  • <DELIMITER = 'character';>
  • <SHEET = "worksheet-name";>
  • <LABEL;>
  • RUN;
  • Keyword Purpose
  • DATA= The SAS data set to export; accepts data set options such as WHERE= , KEEP= , and OBS=
  • OUTFILE= Physical path of the file to create — used for CSV, TAB, DLM, JMP, and XLSX
  • OUTTABLE= Name of a table to create inside a database or a workbook
  • DBMS= The output format identifier
  • REPLACE Overwrite the target if it already exists; without it SAS refuses and writes an error

Exam Trap: omitting REPLACE when the target file already exists does not silently overwrite. SAS writes ERROR: File already exists and produces nothing. Expect at least one distractor built on this.

2. The DBMS Identifiers Named by the Content Guide

  • DBMS= Produces Notes
  • CSV Comma-separated text The default delimiter is a comma; PUTNAMES=YES by default
  • TAB Tab-delimited text Equivalent to DLM with a tab character
  • DLM Delimited text with a delimiter you choose Requires a DELIMITER= statement
  • JMP A JMP .jmp data table For the SAS JMP statistical discovery application

XLSX A Microsoft Excel .xlsx workbook Accepts a SHEET= statement to name the worksheet /* 1. Comma-separated values */

  • proc export data=work.final_report
  • outfile="C:\Reports\2026_Q1_Summary.csv"
  • dbms=csv
  • replace;
  • putnames=yes; /* variable names in row 1 - the default */
  • run;
  • /* 2. Tab-delimited text */
  • proc export data=work.final_report
  • outfile="C:\Reports\2026_Q1_Summary.txt"
  • dbms=tab
  • replace;
  • run;
  • /* 3. Pipe-delimited text */
  • proc export data=work.final_report
  • outfile="C:\Reports\2026_Q1_Summary.psv"
  • dbms=dlm
  • replace;
  • delimiter='|';
  • run;
  • /* 4. A JMP data table */
  • proc export data=work.final_report
  • outfile="C:\Reports\2026_Q1_Summary.jmp"
  • dbms=jmp
  • replace;
  • run;
  • /* 5. An Excel workbook with a named worksheet */
  • proc export data=work.final_report
  • outfile="C:\Reports\2026_Q1_Summary.xlsx"
  • dbms=xlsx
  • replace;
  • sheet="Q1 Summary";
  • run;
  • PUTNAMES= and LABEL
  • Statement Effect on the header row
  • PUTNAMES=YES (default) Writes variable names as the first row
  • PUTNAMES=NO Writes no header row — data begins on line 1
  • LABEL Writes variable labels instead of names
  • Exam Trap: PUTNAMES= belongs to PROC EXPORT and GETNAMES= belongs to PROC IMPORT . The pairing is easy

to remember from the direction of travel: you get names when reading in and put names when writing out.

Exporting a Subset

Because DATA= accepts data set options, no intermediate DATA step is needed: proc export data=work.orders(where=(Region='West') keep=OrderID Amount OrderDate)

  • outfile="C:\Reports\west_orders.csv"
  • dbms=csv
  • replace;
  • run;
  • 3. Exporting to Excel with the SAS/ACCESS XLSX Engine

The second expanded bullet asks specifically for the XLSX engine , which is a different mechanism from DBMS=XLSX . A LIBNAME statement with the XLSX engine treats a workbook as a SAS library: each worksheet becomes a member you can read or write with ordinary SAS code. /* Assign the workbook as a library */

libname xlout xlsx "C:\Reports\CompanyData.xlsx";

  • /* Each DATA step creates or replaces a worksheet */
  • data xlout.Q1_Summary;
  • set work.final_report;
  • run;
  • data xlout.Q1_Detail;
  • set work.orders;
  • run;
  • /* PROC COPY writes several sheets at once */
  • proc copy in=work out=xlout;
  • select regional_totals product_mix;
  • run;
  • /* Clearing the libref closes the workbook and releases the file lock */
  • libname xlout clear;
  • Approach Best when
  • PROC EXPORT ... DBMS=XLSX A single data set becomes a single worksheet
  • LIBNAME ... XLSX Several worksheets are written, or DATA step and PROC COPY logic is involved
  • ODS EXCEL The output needs formatting — styles, titles, colours, autofilters
  • Exam Trap: the XLSX engine writes raw data tables , not formatted reports. Titles, footnotes, and style
  • templates are ignored. When a question mentions colours, embedded titles, or multiple tabs of formatted report

output, the answer is ODS EXCEL , not the XLSX engine.

Always clear the libref. Until LIBNAME xlout CLEAR; executes, SAS holds the workbook open and Excel cannot.

4. The DATA Step Alternative

PROC EXPORT is described in the content guide as an alternative to the DATA step , which implies knowing what it replaces. A DATA _NULL_ step with FILE and PUT gives complete control over the layout: data _null_;

  • set work.final_report;
  • file "C:\Reports\manual_export.csv" dlm=',' dsd;
  • if _n_ = 1 then put "OrderID,Region,Amount"; /* hand-written header */
  • put OrderID Region Amount;
  • run;
  • Consideration PROC EXPORT DATA _NULL_ with PUT
  • Lines of code Minimal Every column written explicitly
  • Header row Automatic via PUTNAMES= Hand-coded
  • Layout control Limited to the DBMS= conventions Total
  • Applies formats Uses the variable's assigned format Whatever you specify in the PUT
  • Fixed-width output Not supported Fully supported with column pointers

Choose PROC EXPORT for standard delimited and Excel output, and the DATA step when the receiving system demands an exact layout.