Spss Sav File Format

Posted on by

IBM® SPSS® Statistics data files are files specifically formatted for use by IBM SPSS Statistics, containing both data and the metadata (dictionary) that define the data. To save the active dataset in IBM SPSS Statistics format, use SAVE or XSAVE. On most operating systems, the default extension of a saved IBM SPSS Statistics data file is.sav. Each time you open a data file from the GUI, SPSS generates syntaxthat may look something like GET FILE='C: Documents and Settings Work Projects 2012 December Some Customer Survey data.sav'. This exact specification of the folder and the file name is known as a absolute path. Using absolute paths has two disadvantages. IBM® SPSS® Statistics data files are files specifically formatted for use by IBM SPSS Statistics, containing both data and the metadata (dictionary) that define the data. To save the active dataset in IBM SPSS Statistics format, use SAVE or XSAVE. On most operating systems, the default extension of a saved IBM SPSS Statistics data file is.sav.

  • Apr 03, 2019 Data file created by SPSS (Statistical Package for the Social Sciences), an application used for statistical analysis; saved in a proprietary binary format and contains a dataset as well as a dictionary that describes the dataset; saves data by 'cases' (rows) and 'variables' (columns).
  • A description of the SPSSsavfamily formats is available in the Developers Guide for the open-source GNU PSPP application. GNU PSPP is a program for statistical analysis of sampled data, intended as a replacement for the proprietary SPSS. It claims to use syntax and data files which are compatible with those of SPSS.

SPSS data sets

If you have read data from a different format than SPSS, or if you have modified an existing SPSS file, you may wish to save your file for further use in SPSS format. This is done with the SAVE FILE command.

Example:

Spss

SAVE OUTFILE = 'd:mydirectorymysubdirectorymydata.sav'.

where you have to fill in your directory and data set names. Note that SPSS issues no warning if you overwrite an existing data set, thus be careful in the choice of the name of this data set. Of course, if you have modified an existing data set, using the old name may be exactly what you want. However, this should only be done if you have augmented your data set, i.e. if you have added new variables. If you have changed, or even deleted, old variables, as a beginner you should use a different name for your data set even if you have changed or deleted these variables precisely because you wanted to get rid of them. But perhaps you have committed a mistake and wish to redo your modifications in a different way; this will be impossible if the original variables have not been kept somewhere.

Spss Sav File Format Pdf

As with the GET FILE command, the KEEP, DROP and RENAME subcommands are available to change your data file during the SAVING process. If you want to get rid of most of your variables, it is useful to indicate which variables you want to KEEP; if you want to keep most of the variables, you will prefer to indicate which variables to DROP. Renaming variables can be useful for various purposes. Here's an example:

SAVE OUT = 'd:mydirectorymysubdirectorymydata.sav'
/ DROP var11 var15 var17 var88
/ RENAME (var10 var19 = gender age).

Note that SAVing your data file does not affect your working file. Thus, if you wish to use the SAVed data set for your next analysis steps, you first have to read in the file anew with the GET FILE command. This may happen more frequently than you think; for instance, you may have modified your data, and in the process a number of 'intermediate' variables may have been used which are not of interest by themselves, but were needed in one way or other for creating new variables of interest. (For instance, you may wish to compute the overall household income from different types of income of several persons in a household; this may easily amount to hundred variables or more.) But when you have finished your task, these variables are no longer useful and only render your data set unnecessarily large. This is the moment when it is a good choice to SAVe your data and DROP those variables you don't need any longer (or to KEEP those with which you wish to pursue your work).

Saving your data in another format

For some reason or other, you may wish to analyze your data with other software. This 'other software' may be able to read SPSS data, but much more frequently than not this is not the case. SPSS can assist you by saving the data either in a specific format or in a general format that can be read by most software.

Here is a small selection of possibilities.

Saving data as a Stata™ file

Spss
SAVE TRANSLATE OUT = 'd:mydirmystatadata.dta'
/ TYPE=STATA
/ VERSION=8
/ EDITION=SE
/ DROP var17 var20 var24
/ REPLACE.

REPLACE will do what it looks like doing, i.e. any existing file with the same name will be overwritten. Of course, you may omit this command.

Saving data as a comma delimited file

In this type of file, the data will be in 'raw' format, with each data value separated from the next by a comma. This may be read by a variety of other software.

SAVE TRANSLATE OUT = 'd:mydirmycsvdata.csv'
/ TYPE=CSV
/ MAP.

MAP will produce an exact list of all variables written to the new file. Of course, the DROP and KEEP subcommands may be used as well.

Saving data as a tabulator delimited file

Use the same command as with a comma delimited file, but use TYPE=TAB instead.

Saving data in a plain ASCII file

To save your data just as raw data and nothing else (no delimiters, no other characters), the command goes like this:

WRTIE OUT = 'd:mydirmyasciidata.txt' TABLE
/ var1 var17 var18 to var24.
EXECUTE.

If you just wish to WRITE the entire data set, use ALL instead of a varlist.

This procedure will produce an ASCII file in FIXED FORMAT (see section Read Raw Data on how to read such a file). Keyword TABLE will make SPSS produce an exact description of the data set. Note that WRITE will be accomplished only upon execution of another command or with the help of EXECUTE, as demonstrated here.

© W. Ludwig-Mayerhofer, IGSW Last update: 16 Sep 2009

Previous PageNext Page
File Format-Specific Reference for the IMPORT and EXPORT Procedures
SAV File Essentials

All versions of SPSS under Microsoft Windows are supported. SPSS fileshave a .sav file extension. SPSS files that have short variable names areexported.

See: Example 1: EXPORT a SAS Data Set to an SPSS SAV File

SPSS Data Types
MISSING VALUES

SPSS supports missing values. SAS missing valuesare written as SPSS missing values.

VARIABLE NAMES

Only the short variable name style is supported.SPSS variable names can be up to eight characters in length. All alphabeticcharacters must be uppercase. The first character in a variable name can bean uppercase letter (A-Z), a dollar sign ($), or an 'at' sign (@). Subsequentcharacters can be any of these characters, plus numerals (0-9), periods (.),number signs (#), or underscores ( _ ).

SPSS reserves 13 words, which are not allowed to stand alone as variablenames: ALL, AND, BY, EQ, GE, GT, LE, LT, NE, NOT, OR, TO, and WITH. If theprogram encounters any of these as a variable name, it appends an underscoreto the variable name to distinguish it from the reserved word. For example, ALL becomes ALL_.

Invalid characters are converted to underscores unless they are encounteredas the first character in a variable name. In that event, the 'at' sign (@)is used instead. For example, %ALL becomes @ALL.

When you are exporting to SPSS, SAS variable names that are longer thaneight characters are truncated to eight characters. If the new name is truncatedand results in an existing name, the last character changes to a single digit(1,2, 3..) until the variable name becomes unique. She aint you chris brown mp3 download.

VALUE LABELS

SPSS stores value labels within the data file. Thevalues are turned into format library entries as they are read with the IMPORTprocedure. The name of the format includes its associated variable name, modifiedto meet the requirements of format names. The name of the format is also associatedwith a variable in the data set. You can use the FMTLIB=libref.format-catalog;statement to save the formats catalog in a specified SAS library.

The EXPORT procedure saves the value labels that are associated withthe variables when writing to an SPSS file. The procedure uses the formatsthat are associated with the variables to retrieve the value entries. Youcan use the FMTLIB=libref.format-catalog statement to tell SAS the locationof the format catalog.

VARIABLE LABELS

SPSS supports variable labels. the EXPORT procedurewrites the variable name to an SPSS file as the label if the variable nameis not a valid SPSS name and no label exists.

DATA TYPES

SPSS supports numeric and character field types thatmap directly to SAS numeric and character fields. This list shows other SPSSdata types and how the IMPORT procedure converts them to SAS formats.

Date, Jdate, Wkday, Qyr, Wkyr: Date, Jdate, Wkday, Qyr, Wkyr

Datetime, Dtime: Converts to a SAS datetime value and SAS datetimeformat.

Time: Converts to a SAS datetime value and SAS datetime format.

Adate: Converts to a SAS date value in the mmddyyformat.

Moyr: Converts to a SAS date value in the mmmyy format.

When writing SAS data to an SPSS file, the EXPORT procedure convertsdata into SPSS variable types.

When exporting data, character fields have a maximum length of 256.

Numeric fields are 8-byte floating-point numbers, with these formatconversions:

COMMA

Converts to SPSS format type comma.

DOLLAR

Converts to SPSS format type dollar.

DATE

Converts to SPSS format type date.

MMDDYY

Converts to SPSS format Adate.

MMMYY

Converts to SPSS format Moyr.

DATETIME

Converts to SPSS format Dtime.

TIME

Converts to SPSS format Time.

Importing and Exporting Data in SPSS Files
PC Files Server (DBMS=PCFS)

This IMPORT EXPORT method uses the client/servermodel to access data in Stata files on Microsoft Windows from Linux, UNIX,or Microsoft Windows 64-bit operating environments. This method requires runningthe PC Files Server on Microsoft Windows.

A filename with a .sav extension is required.
IMPORT Procedure and the EXPORT Procedure Supported Syntax
FMTLIB=libref.format-catalog

When importing an SPSS file, SAS saves value labels to aspecified SAS format catalog. When exporting a SAS data set to an SPSS file,SAS writes the specified SAS format catalog to the SPSS file.


Example 1: EXPORT a SAS Data Set to an SPSS SAV File

This example exports the SAS data set SDF.CUSTOMER, to the SPSS file,CUSTOMER.SAV, on a local system.


Example 2: Import a SAS Data Set from an SPSS SAV File

This example imports data from customer.sav, on a local system, to theSAS data set WORK.CUSTOMER.


Example 3: Export a SAS Data Set on UNIX to an SPSS File on Microsoft Windows

Spss Sav File Format Software

This example exports a SAS data set named SDF.CUSTOMER to an SPSS filenamed CUSTOMER.SAV. Note that SAS is running on the UNIX operating platform.The SPSS file is loaded on Microsoft Windows where PC Files Server is running.


Example 4: IMPORT Data from an SPSS File on Microsoft Windows to a SAS Data Set on UNIX

This example imports data from an SPSS file named CUSTOMER.SAV toaSAS data set named WORK.CUSTOMER. Note that SAS is running on a UNIX platform.The SPSS file is located on Microsoft Windows where PC Files Server is running.

Spss Sav File Format Download

Previous PageNext PageTop of Page