Transferring data from IBM SPSS Statistics
You can transfer data from a
.sav file using SPSS Statistics SAV DSC. For information about how SPSS Statistics SAV DSC interprets the information in the
.sav file, see
SPSS Statistics SAV DSC.
When you are reading a .sav file that you have previously created using the UNICOM Intelligence Data Model, it is preferable to read it using the .mdd file that was used when creating it whenever possible (that is the output metadata file if you created the .sav file using a DMS file.) This means that the variable names will match those in the .mdd file. If you connect specifying the SPSS Statistics SAV DSC as the MDSC, the variable names will be closer to those in the .sav file, but the names will be changed, if necessary, to make them valid in the MDM.
UNICOM Intelligence Professional provides only limited support for Japanese characters when working with .sav files. In particular, Japanese characters that appear in .sav file variable names are sometimes not handled correctly when you read the metadata using the SPSS Statistics SAV DSC. This can result in incorrect variable names in the output. If the .sav file was created by a previous export, you can get around this problem by using the .mdd file used for that export (the output metadata file if the export was done using a DMS file) as the input metadata source for the transfer.
How do I specify reading from a .sav file?
1. Using SPSS Statistics SAV DSC to read the metadata
In the connection string in
InputDataSource section, specify
mrSavDsc for both the
Data Source and the
MR Init MDSC connection properties. Specify the name and location of the
.sav file for both the
Location and
Initial Catalog connection properties:
InputDatasource(myInputDataSource, "My input data source")
ConnectionString = "Provider=mrOleDB.Provider.2; _
Data Source=mrSavDsc; _
Location=<Name and location of .sav file>; _
Initial Catalog=<Name and location of .sav file>; _
MR Init MDSC=mrSavDsc"
End InputDatasource
2. Using an .mdd file
In the connection string in the
InputDataSource section, specify
mrSavDsc for the
Data Source connection property, and leave the
MR Init MDSC connection property blank. Specify the name and location of the
.sav file for the
Location connection property and specify the name and location of the
.mdd file for the
Initial Catalog connection property:
InputDatasource(myInputDataSource, "My input data source")
ConnectionString = "Provider=mrOleDB.Provider.2; _
Data Source=mrSavDsc; _
Location=<Name and location of .sav file>; _
Initial Catalog=<Name and location of .mdd file>"
End InputDatasource
Examples
1. Using SPSS Statistics SAV DSC to read the metadata
This example uses SPSS Statistics SAV DSC to read both the case data and the metadata in the Employee data sample .sav file.
InputDatasource(myInputDataSource, "My input data source") ConnectionString = "Provider=mrOleDB.Provider.2; _ Data Source=mrSavDsc; _ Location=" + InputSav + "; _ Initial Catalog=" + InputSav + "; _ MR Init MDSC=mrSavDsc" End InputDatasource
Note This example is in the
SavInput.dms Include file that is installed with the UNICOM Intelligence Developer Documentation Library. For more information, see
Sample DMS include files.
2. Using an .mdd file
This example uses SPSS Statistics SAV DSC to read the case data in the Employee data sample
.sav file, but uses the metadata in an
.mdd file. If an
.mdd file is not available, you could create the
.mdd file in the OnBeforeJobStart Event section. For more information, see
Creating an .mdd file from proprietary metadata.
InputDatasource(myInputDataSource, "My input data source") ConnectionString = "Provider=mrOleDB.Provider.2; _ Data Source=mrSavDsc; _ Location=C:\Program Files\UNICOM\Intelligence\<version>\DDL\Data\Sav\Employee data.sav; _ Initial Catalog=C:\Program Files\UNICOM\Intelligence\<version>\DDL\Output\Employee data.mdd" End InputDatasource
Note This example is similar to that in the
SavToRDB.dms sample DMS file, which is installed with the UNICOM Intelligence Developer Documentation Library. For more information, see
Sample DMS files.
See also