Title stata.com
export Overview of exporting data from Stata
Description Remarks and examples Also see
Description
This entry provides a quick reference for determining which method to use for exporting Stata
data from memory to other formats.
Remarks and examples stata.com
Remarks are presented under the following headings:
Summary of the different methods
export excel
export delimited
jdbc
odbc
outfile
export sasxport5 and export sasxport8
export spss
export dbase
Summary of the different methods
export excel
export excel creates Microsoft Excel worksheets in .xls and .xlsx files.
Entire worksheets can be exported, or custom cell ranges can be overwritten.
See [D] import excel.
export delimited
export delimited creates comma-separated or tab-delimited files that many other programs can
read.
A custom delimiter may also be specified.
The first line of the file can optionally contain the names of the variables.
See [D] import delimited.
1
2 export Overview of exporting data from Stata
jdbc
Java Database Connectivity (JDBC) is an application programming interface for the programming
language Java. The jdbc command allows you to connect to, load data from, insert data into, and
execute queries on a database using JDBC.
See [D] jdbc.
odbc
ODBC, an acronym for Open DataBase Connectivity, is a standard for exchanging data between
programs. Stata supports the ODBC standard for exporting data via the odbc command and can
write to any ODBC data source on your computer.
See [D] odbc.
outfile
outfile creates text-format datasets.
The data can be written in space-separated or comma-separated format.
Alternatively, the data can be written in fixed-column format.
See [D] outfile.
export sasxport5 and export sasxport8
export sasxport5 saves SAS XPORT Version 5 Transport format files.
export sasxport5 can also write value-label information to a formats.xpf XPORT file.
export sasxport8 saves SAS XPORT Version 8 Transport format files.
export sasxport8 can also write value-label information to a SAS command (.sas) file.
See [D] import sasxport5 and [D] import sasxport8.
export spss
export spss saves an IBM SPSS Statistics (.sav) file.
See [D] import spss.
export dbase
export dbase saves version IV dBase (.dbf) files.
See [D] import dbase.
export Overview of exporting data from Stata 3
Also see
[D] import Overview of importing data into Stata
[M-5] docx*( ) Generate Office Open XML (.docx) file
[M-5] xl( ) Excel file I/O class
[RPT] dyndoc Convert dynamic Markdown document to HTML or Word (.docx) document
[RPT] putdocx intro Introduction to generating Office Open XML (.docx) files
[RPT] putexcel Export results to an Excel file
[RPT] putpdf intro Introduction to generating PDF files
Stata, Stata Press, and Mata are registered trademarks of StataCorp LLC. Stata and
Stata Press are registered trademarks with the World Intellectual Property Organization
of the United Nations. StataNow and NetCourseNow are trademarks of StataCorp
LLC. Other brand and product names are registered trademarks or trademarks of their
respective companies. Copyright
c
19852023 StataCorp LLC, College Station, TX,
USA. All rights reserved.
®
For suggested citations, see the FAQ on citing Stata documentation.