SAV (.sav, .zsav)

Background

    • MIME type: application/x-spss-sav
    • SPSS database transport format.
    • Legacy data exchange format.
    • Stores numerical datasets in a portable format.
    • Binary format.
    • SPSS was initially released in 1968 by Norman H. Nie, Dale H. Bent and C. Hadlai Hull.
    • Maintained by SPSS Inc. since 1975, and by IBM SPSS Statistics since 2009.

Import & Export

  • Import["file.sav"] imports an SAV file, returning all datasets arranged as a table.
  • SAV data is represented in the Wolfram Language by real or integer numbers, strings, Boolean values True and False, and DateObject specifications.
  • Import["file.sav",elem] imports the specified element from an SAV file.
  • Import["file.sav",{elem,suba,subb,}] imports a subelement.
  • The import format can be specified with Import["file","SAV"] or Import["file",{"SAV",elem,}].
  • See the reference pages for full general information on Import.
  • ImportString supports the SAV format.

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties and settings
    "Summary"summary of file size and dimensions
  • Data representation elements:
  • "Data"two-dimensional array
    "Dataset"table data as a Dataset
    "LabeledData"association of labels and data
  • Import by default uses the "Data" element.
  • Data descriptor elements:
  • "LabelDescriptions"description and types of columns
    "Labels"names of columns
    "MissingPositions"positions of elements considered to be missing per column
    "MissingValues"values to be considered missing per column
  • Metadata elements:
  • "ByteOrdering"endianness of the data
    "CharacterEncoding"character encoding of the file
    "Comments"comments on the file
    "Compression"type of compression used in the file
    "CreationDate"creation date of the document, given as a DateObject
    "Dimensions"dimensions of the data
    "MetaInformation"metadata given as strings and date objects
    "ModificationDate"modification date of the document, given as a DateObject
    "TableName"name of the entire table
    "Version"version of the SAS specification for the file

Options

  • Import options:
  • "ColumnDefaultValues"Automaticassociation of column names and default values
    "TypeDefaultValues"Automaticassociation of types and default values

Examples

open allclose all

Basic Examples  (2)

Import an SAV file:

Summary of an SAV file:

Import Elements  (14)

Data Representation  (3)

"Data"  (1)

Import an SAV file as a 2D list of values:

This is also the default element:

"Dataset"  (1)

Import an SAV file as a Dataset:

"LabeledData"  (1)

Import an SAV file as an association of labels and data:

Data Descriptors  (3)

"LabelDescriptions"  (1)

Import associations giving the name, description and type for each column in an SAV file:

"Labels"  (1)

Import the names of each column in an SAV file:

"MissingPositions"  (1)

Import associations giving the positions of missing values by column:

Metadata  (8)

"ByteOrdering"  (1)

Import the byte ordering stored in the metadata of an SAV file:

"CharacterEncoding"  (1)

Import the character encoding stored in the metadata of an SAV file:

"Comments"  (1)

Import comments stored in the metadata of an SAV file:

"CreationDate"  (1)

Import the creation date:

"Dimensions"  (1)

Import the data dimensions:

"MetaInformation"  (1)

Import an association of all the metadata stored in an SAV file:

"ModificationDate"  (1)

Import the modification date:

"Version"  (1)

Import the version of an SAV file:

Import Options  (2)

"ColumnDefaultValues"  (1)

Missing numerical values are replaced with zero by default:

Use "ColumnDefaultValues" to specify a different default value for specific columns:

"TypeDefaultValues"  (1)

Missing numerical values are replaced with zero by default:

Use "TypeDefaultValues" to specify a different default value for specific types: