SAV (.sav, .zsav)
Background & Context
-
- 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
- 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,…}].
- Export["file.sav",expr] creates an SAV file from expr.
- Supported expressions expr include:
-
{v1,v2,…} a single column of data {{v11,v12,…},{v21,v22,…},…} lists of rows of data array an array such as SparseArray, QuantityArray, etc. tseries a TimeSeries, EventSeries or TemporalData object Dataset[…] a dataset <"name1"expr1,… > an association of named columns - Import and Export support the following data types:
-
"Date" date and time specifications "Integer8" 8-bit integers "Integer16" 16-bit integers "Integer32" 32-bit integers "Real32" IEEE single‐precision numbers "Real64" IEEE double‐precision numbers "String" string of characters - See the following reference pages for full general information:
-
Import, Export import from or export to a file CloudImport, CloudExport import from or export to a cloud object ImportString, ExportString import from or export to a string ImportByteArray, ExportByteArray import from or export to a byte array
Import Elements
- General Import elements:
-
"Elements" list of elements and options available in this file "Summary" summary of the file "Rules" list of rules for all available elements - 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:
-
"ColumnDescriptions" 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" Automatic association of column names and default values "TypeDefaultValues" Automatic association of types and default values - Export options:
-
"ColumnDescriptions" Automatic list of descriptions for each column "MetaInformation" Automatic association of metadata tags and values - Possible settings for "ColumnDescriptions" include:
-
{"label1","label2", …} list of strings giving column names {assoc,…} list of associations giving column metadata <colassoc > association of index or column name and column metadata - Possible keys for assoc include:
-
"Name" string giving the column's name "Description" string giving the column's description "Type" string giving the column's type "MissingValues" values to be considered missing for the column - Possible keys for "MetaInformation" include:
-
"Comments" string giving general comments on the file "CreationDate" date object giving the creation date of the file "ModificationDate" date object giving the modification date of the file "TableName" string giving the name of the entire table "Version" integer giving the version of the file
Examples
open allclose allBasic Examples (3)
Scope (5)
Export a Dataset:
Column names are automatically inferred:
Column names are automatically generated:
Export an association of named columns:
Column names are automatically inferred:
Export a TimeSeries:
Times are stored in the first column, values in the second:
Ragged arrays are automatically padded on the right and converted to full arrays:
Import Elements (15)
Data Representation (3)
"Dataset" (1)
Import an SAV file as a Dataset: