Convert XPT to JSON
Turn XPT files into JSON. An array with one object per case keyed by variable name, with numbers written as decimals such as 34.0 and empty values as null.
Converted in an isolated sandbox on our serversDeleted after 24 hours
Drop XPT files on the dialor turn it to pick what to do
SAS Transport data as plain JSON.Each case becomes one object, keyed by variable name.
What you get
One JSON file holding an array. Each case in the XPT file is one object in that array, and each variable name is a key.
Numbers are written as decimals, such as 34.0. Empty values are written as null.
What it leaves behind
Value labels, variable labels and missing-value definitions are dropped. Coded answers stay numbers, so a answer stored as a code appears in the JSON as that number, not as its label.
When it fails
If the file cannot be parsed, the conversion stops with
input_corrupted. The XPT file is damaged or not readable as SAS Transport data.To combine several JSON files after converting, you can merge JSON.
XPT and JSON.What each format is.
The formats
SAS Transport
SAS transport files, the exchange format regulators accept.
- Extensions
- .xpt
- MIME type
- application
/x -sas -xport - Kind
- Text and data
JSON
JSON, the data format of every API.
- Extensions
- .json
- MIME type
- application
/json - Kind
- Text and data
In your code.The same XPT to JSON conversion through the API, for your app or your agent.
$ cv convert report.xpt report.json$ cv convert report.xpt report.jsonQuestions.What people ask about XPT to JSON.
No. Value labels are dropped, so coded answers stay numbers.
No. Only the variable names are kept, as the keys of each object.
Empty values are written as null.
The file could not be parsed. The conversion stops there and produces no JSON.