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.

  1. 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.

  2. 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.

  3. 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

From · XPT

SAS Transport

SAS transport files, the exchange format regulators accept.

Extensions
.xpt
MIME type
application/x-sas-xport
Kind
Text and data
To · JSON

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.

terminal
$ cv convert report.xpt report.json
$ cv convert report.xpt report.json

Questions.What people ask about XPT to JSON.

01OF 04

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.

More conversions.Other ways in and out of XPT and JSON.