EXPORT Procedure

Example 2: Exporting a Subset of Observations to a CSV File

Features:
PROC EXPORT statement options:
DATA=
DBMS=
OUTFILE=
REPLACE

Details

This example exports the SAS data set SASHELP.CLASS. The WHERE option requests a subset of the observations. The OUTFILE option specifies the output file. The DBMS option specifies that the output file is a CSV file, and overwrites the target CSV, if it exists.

Program

proc export data=sashelp.class (where=(sex='F'))
     outfile="c:\myfiles\Femalelist.csv"
     dbms=csv 
     replace;
run;