Saving data files in SAS format

Special handling is given to various aspects of your data when saved as a SAS file. These cases include:

  • Certain characters that are allowed in IBM® SPSS® Statistics variable names are not valid in SAS, such as @, #, and $. These illegal characters are replaced with an underscore when the data are exported.
  • IBM SPSS Statistics variable names that contain multibyte characters (for example, Japanese or Chinese characters) are converted to variables names of the general form Vnnn, where nnn is an integer value.
  • IBM SPSS Statistics variable labels containing more than 40 characters are truncated when exported to a SAS v6 file.
  • Where they exist, IBM SPSS Statistics variable labels are mapped to the SAS variable labels. If no variable label exists in the IBM SPSS Statistics data, the variable name is mapped to the SAS variable label.
  • SAS allows only one value for system-missing, whereas IBM SPSS Statistics allows numerous user-missing values in addition to system-missing. As a result, all user-missing values in IBM SPSS Statistics are mapped to a single system-missing value in the SAS file.
  • SAS 6-8 data files are saved in the current IBM SPSS Statistics locale encoding, regardless of current mode (Unicode or code page). In Unicode mode, SAS 9 files are saved in UTF-8 format. In code page mode, SAS 9 files are saved in the current locale encoding.
  • A maximum of 32,767 variables can be saved to SAS 6-8.
  • SAS data file names can be up to 32 characters in length. Blank spaces and non-alphanumeric characters other than the underscore ("_") are not allowed and names have to start with a letter or an underscore, numbers can follow.

Save value labels

You have the option of saving the values and value labels associated with your data file to a SAS syntax file. This syntax file contains proc format and proc datasets commands that can be run in SAS to create a SAS format catalog file.

This feature is not supported for the SAS transport file.

Variable types

The following table shows the variable type matching between the original data in IBM SPSS Statistics and the exported data in SAS.

Table 1. How SAS variable types and formats map to IBM SPSS Statistics types and formats
IBM SPSS Statistics Variable Type SAS Variable Type SAS Data Format
Numeric Numeric 12
Comma Numeric 12
Dot Numeric 12
Scientific Notation Numeric 12
Date Numeric (Date) for example, MMDDYY10, ...
Date (Time) Numeric Time18
Dollar Numeric 12
Custom Currency Numeric 12
String Character $8