Acquire / file · All operations
Read a statistics package file
A variant of Read another file format
Read a data file saved by a statistics package, such as SAS, SPSS, Stata or R, into a table.
Status
- In arcform
Not built yet
arcform does not do this yet. Its place on the roadmap
What other tools call it
Meridian's classification; an independent blind rating agreed on 95.7% of 324 rows (variant, version 3).
Apache Hop (1)
SAS inputread 2026-09-27Read SAS sas7bdat data files
EasyMorph (2)
Import SAS fileread 2026-09-27Read a SAS .sas7bdat file
Import SPSS fileread 2026-09-27Read an SPSS or PSPP .sav file
KNIME Analytics Platform (1)
KNIME SAS7BDAT Reader (extension)read 2026-09-27Extension outside the base install: 1 current node: SAS7BDAT Reader
OpenRefine (1)
PC-Axis (PX)read 2026-09-27Read a PC-Axis statistical file
Pentaho Data Integration (1)
SAS Inputread 2026-09-27Read SAS sas7bdat files
Power Query M (1)
RData.FromBinaryread 2026-09-27Read the data frames of an RData file into a record of tables
RapidMiner Studio (3)
Read SASread 2026-09-27Read a SAS data file into a table
Read SPSSread 2026-09-27Read an SPSS file into a table
Read Stataread 2026-09-27Read a Stata data file into a table
VisiData (4)
dta (loader)read 2026-09-23Load Stata file via pandas
sas7bdat (loader)read 2026-09-23Load SAS data file
spss (loader)read 2026-09-23Load SPSS statistics file; also filetype sav
xpt (loader)read 2026-09-23Load SAS transport file
Background
In R, the haven package reads and writes various data formats used by other statistical packages, among them SAS, SPSS and Stata.[1] ReadStat, the C library haven wraps, reads SAS7BDAT and XPORT files from SAS, DTA files from Stata, and POR, SAV and ZSAV files from SPSS.[1][2]
When to use it
In haven, a labelled vector, a common data structure in other statistical environments, assigns text labels to specific values, and its labels need not be exhaustive.[3] Haven translates value labels into a labelled() class that preserves their original semantics and can be coerced to factors with as_factor().[1] In pandas, read_stata reads value labels and converts the columns to categorical variables by default, through its convert_categoricals option.[4] Keep both the code and its label when reading a labelled column, since a code without its label is a number with no meaning. (Meridian's view)
SAS records value labels in a separate sas7bcat catalog file, which haven's read_sas() reads alongside the sas7bdat data file.[5] Ask for the catalog file along with a SAS dataset, or its value labels will be lost. (Meridian's view)
In pandas, read_stata replaces Stata's missing values with NaN (not a number) unless convert_missing is set, which keeps them as StataMissingValue objects.[4] Before counting missing values, check whether the reader kept the file's kinds of missing value apart or merged them into one. (Meridian's view)
The method
ReadStat reads Stata DTA files of versions 104 to 119.[2] ReadStat's command-line tool converts value labels, but not the finer nuances of format strings such as %8.2g.[2] ReadStat leaves R data files to a related project, librdata.[2]
Haven converts dates and times to R date and time classes, and does not convert character vectors to factors.[1] Haven's read_sas() takes an encoding argument, where NULL uses the encoding specified in the file, to be overridden when that is incorrect.[5] Haven's read_sas() stores each variable's label in its label attribute.[5]
Sources
- [1]Import and Export SPSS, Stata and SAS Files • havendocumentation
- [2]GitHub - WizardMac/ReadStat: Command-line tool (+ C library) for converting SAS, Stata, and SPSS files 💾 · GitHubdocumentation
- [3]Create a labelled vector. — labelled • havendocumentation
- [4]pandas.read_stata — pandas 3.1.1 documentationdocumentation
- [5]Read SAS files — read_sas • havendocumentation