Products & Services Solutions Academia Support User Community Company

Learn more about Statistics Toolbox   

xptread - Create dataset array from data stored in a SAS XPORT format file

Syntax

data = xptread
data = xptread(filename)
[data,missing] = xptread(filename)
xptread(...,'ReadObsNames',true)

Description

data = xptread displays a dialog box for selecting a file, then reads data from the file into a dataset array. The file must be in the SAS XPORT format.

data = xptread(filename) retrieves data from a SAS XPORT format file filename. The XPORT format allows for 28 missing data types, represented in the file by an upper case letter, '.' or '_'. xptread converts All missing data to NaN values in data. However, if you need the specific missing types then you can recover this information by specifying a second output.

[data,missing] = xptread(filename) returns a nominal array, missing, of the same size as data containing the missing data type information from the xport format file. The entries are undefined for values that are not present and are one of '.', '_', 'A',...,'Z' for missing values.

xptread(...,'ReadObsNames',true) treats the first variable in the file as observation names. The default value is false.

xptread only supports single data sets per file.

Examples

Read in a SAS XPORT format dataset:

data = xptread('sample.xpt')

See Also

dataset | dataset.export

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS