Data Model > Available DSCs > SPSS Statistics SAV DSC > Writing to an SPSS Statistics .sav file > Troubleshooting when writing to a .sav file
 
Troubleshooting when writing to a .sav file
I followed the instructions in the UNICOM Intelligence Developer Documentation Library and created an .mdd file and relational MR database from an IBM SPSS Statistics.sav file. However, when I later tried to export data from the database to a new .sav file, the category values were different. Why, and what can I do to keep them the same?
The raw category values used in the .sav file are not stored in the Metadata Model (MDM) document. When you export to a new .sav file, the category values are sequential and start from 1 (unless you specify settings as described in Variable definitions when writing to a .sav file). In many .sav files the category values start at 0 and are not sequential. For example, .sav category values of 0, 1, 2, and 9 are common. This is why the category values in your export do not match those in your original .sav file. The only way to make the category values match the ones in your original .sav file is to export to the original .sav file. However, this will not work if the structure of the data has changed.
Note that this would not be a problem if your original .sav file had been created by using the SPSS Statistics SAV DSC, or if you had set up the category values in the .sav file to match the native values (that is, sequential integer values starting from 1).
When I export MDM multiple-response categorical variables to a .sav file, some of them are written as multiple category sets instead of multiple dichotomy sets. Multiple dichotomy sets are the default in IBM SPSS Statistics and I have not changed any SPSS Statistics SAV DSC settings, so why is this?
By default, multiple-response categorical variables are exported as multiple dichotomy sets. However, multiple response questions sometimes ask respondents to select a limited number of the responses from the response list. For example, in a survey about films, a question might ask you to select your 3 favorite films from a list of 20 films. When this happens the maximum value (that is, the value of the MDM variable's EffectiveMaxValue property) is set to 3, which is less than the total number of categories (excluding any categories that have the flUser flag set, such as Don't Know). When this happens the multiple response variable is exported as a multiple category set. See "Multiple-Response Categorical Variables" in Variable definitions when writing to a .sav file .
To force the SPSS Statistics SAV DSC to export all multiple-response categorical variables as multiple dichotomy sets, use the CategorySet Properties and settings used by the SPSS Statistics SAV DSC.
I've created a .sav file using the SPSS Statistics SAV DSC. When I open my .sav file in IBM SPSS Statistics 12 or earlier, the values of some of the string variables are truncated.
IBM SPSS Statistics string variables have a limit of 255 bytes in IBM SPSS Statistics 12 and earlier, whereas the .sav files created by the SPSS Statistics SAV DSC are compatible with IBM SPSS Statistics 13 or later and do not have this limitation. Therefore, your .sav file probably contains string variables that are longer than 255 bytes.
I am attempting to export a very large project to .sav, but the export stops responding
By default, there is no limit to the number of attempts that the SPSS Statistics SAV DSC makes to create each unique alias name. It is possible that this has caused your export to stop responding. You could try stopping the export and setting the value of the AliasRetryLimit property to 1000, for example, and then attempting the export again. If the number of retries is too small, the export will fail with an error message similar to the following:
Error : Failed to create target table: SavOutput - Error
creating target schema SavOutput - SAV Could not write
definition of column '<VariableName>' with alias
name '<TruncatedVariableName>'EXEC XP_SYNCDB
See also
Variable names and labels when writing to a .sav file
Variable definitions when writing to a .sav file
Missing values when writing to a .sav file
SPSS WebApp XML file
SPSS Statistics SAV DSC
Writing to an SPSS Statistics .sav file