Data Set [13-14]

Export a SAS Data Set into a text file

Exporting data into a text file is similar to exporting data to an Excel spreadsheet.​

Example

Proc Export Data=Income 
OutFile='/home/your_user_name/Income.txt'
Replace
Dbms=tab;
Run;

Picture

Pay attention to the following when exporting to a text file:

1. File Extension
Use “.txt” as the file extension when exporting to a text file.

2. DBMS option
You can use the DBMS option to select the type of delimiter when exporting to a text file.

DBMS=tab
This will create a tab delimited file.

DBMS=csv
This will create a comma delimited file.

(try it!)

Picture

Exercise

Export the Electric data set into a text file.

Use a tab as the data delimiter.

Need some help?

Get Hint

Get Solution