What is a .sas7bdat file?
SAS Data Set File · Data · SAS Institute · 1990s (SAS 7)
A .sas7bdat file is a SAS dataset, the table format of the SAS analytics system that dominates clinical trials, banking and insurance. The name means SAS version 7 binary data.
What is a .sas7bdat file used for?
SAS is entrenched in regulated industries, pharma submissions above all, so .sas7bdat files are everywhere data leaves a SAS shop. The format is proprietary: it starts with a long fixed binary header that identifies it, but SAS has never published the specification, and open-source readers are built on reverse engineering.
Those readers are mature: pandas, R's haven, and readstat handle typical datasets well. Compressed or encrypted SAS files are the cases where only SAS itself is reliable.
How to open a .sas7bdat file
The .sas7bdat format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list. For a step-by-step walkthrough, see how to open a .sas7bdat file.
Windows
- SAS
- Python (pandas.read_sas)
- R (haven)
- SAS Universal Viewer
macOS
- Python (pandas)
- R (haven)
Linux
- Python (pandas)
- R (haven)
How to convert a .sas7bdat file
You can convert a .sas7bdat file to csv, parquet, xlsx using a conversion tool or the export menu of an app that opens it.
.sas7bdat file signature (magic bytes)
Programs recognise a .sas7bdat file by the bytes at the start of the file, not by its name. These are the signatures for SAS Dataset.
| Hex signature | Offset | Note |
|---|---|---|
| (no fixed signature) | 0 | no fixed magic; structure defined by a schema or header |
See the full magic-numbers reference for every format.
Frequently asked questions
What is a .sas7bdat file?
A .sas7bdat file is a SAS dataset, the table format of the SAS analytics system that dominates clinical trials, banking and insurance. The name means SAS version 7 binary data.
How do I open a .sas7bdat file without SAS?
pandas.read_sas() in Python or haven::read_sas() in R open most files free of charge. SAS also offers the no-cost SAS Universal Viewer on Windows for looking without converting.
Why is my .sas7bdat file unreadable outside SAS?
It is probably compressed (BINARY/CHAR compression) or encrypted, options the reverse-engineered readers only partly support. Export from SAS to CSV or XPT in that case.
What is the difference between .sas7bdat and .xpt?
.sas7bdat is SAS's native dataset; .xpt is the open SAS Transport format required by regulators like the FDA precisely because its layout is publicly documented.
Related formats
Sources
Details on this page were checked against authoritative references: