Desktop User Guides > Professional > Data management scripting > Getting started with Data Management scripting > 3. Transferring different types of data
 
3. Transferring different types of data
Generally DMS files use the UNICOM Intelligence Data Model and its data source components (DSCs), to read and write data in different formats. DMS files can also transfer data using OLE DB providers that are not part of the UNICOM Intelligence Data Model. However, this topic provides an introduction to transferring different types of data using the UNICOM Intelligence Data Model and its DSCs.
For an introduction to the UNICOM Intelligence Data Model, see UNICOM Intelligence Data Model.
For an introduction to DSCs and information about the DSCs that are supplied with the UNICOM Intelligence Data Model, see Available DSCs.
You can use a DMS file to transfer data from any format for which you have a suitable read-enabled DSC to any format for which have a suitable write-enabled DSC.
This section shows how to set up a DMS file to transfer the Museum sample Quanvert database to a UNICOM Intelligence Data File (.ddf). This transfer uses the Quanvert DSC to read the Quanvert database and the UNICOM Intelligence Data File CDSC to write the UNICOM Intelligence Data File.
First, look at MyFirstTransfer2.dms file in UNICOM Intelligence Professional again. This section assumes that you have created the MyFirstTransfer2.dms file as described in 2. Setting up a filter. If you have not done that, create the file now, so it looks like this:
This graphic is described in the surrounding text.
The InputDataSource section (highlighted in red) is where you define the details that relate to the data you want to transfer. See also InputDataSource section.
The OutputDataSource section (highlighted in blue) is where you define the details that relate to the target data. See also OutputDataSource section.
It is the ConnectionString parameter in each of these sections that defines the name and location of the data and the DSC and other options that you want to use. You can type in the connection string, but you must be careful to spell all of the connection properties and file and path names correctly. For more information, see Connection properties.
However, there is an easier way of setting up the connection string, and that is to use the UNICOM Intelligence Professional Connection String Builder. Let's do that now for the InputDataSource section:
Using the UNICOM Intelligence Professional Connection String Builder
1 In the InputDataSource section, delete the value of the connection string , as shown here:
ConnectionString = "Provider=mrOleDB.Provider.2; _
  Data Source=mrDataFileDsc;
  Location=C:\Program Files\UNICOM\Intelligence\<version>
      \DDL\Data\Data Collection File\museum.ddf;
  Initial Catalog=C:\Program Files\UNICOM\Intelligence\
      <version>\DDL\Data\Data Collection File\museum.mdd"
The connection string should now look like this:
ConnectionString = ""
2 Keeping the cursor between the quotation marks, choose Connection String Builder from the Tools menu.
This opens the Connection Tab in the Data Link Properties (see Data Link Properties: Connection), with the Provider tab set to use the UNICOM Intelligence OLE DB Provider.
3 From the Metadata Type list, select Quanvert Database.
4 Enter the Metadata Location of the Museum sample Quanvert database. You can either type the name and location of the Quanvert qvinfo file into the box, or click Browse. By default, the Museum sample Quanvert database is in this folder:
[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\ Data\Quanvert\Museum
5 From the Case Data Type list, select Quanvert Database.
6 Enter the Case Data Location of the Museum sample Quanvert database exactly as you entered it in the Metadata Location box.
7 Click OK.
This inserts the connection string at the cursor position. Now the InputDataSource section looks like this:
InputDataSource("My input data source")
  ConnectionString = "Provider=mrOleDB.Provider.2;
    Data Source=mrQvDsc;
    Location=C:\Program Files\UNICOM\Intelligence\<version>\
        DDL\Data\Quanvert\Museum\qvinfo;
    Initial Catalog=C:\Program Files\UNICOM\Inteligence\
        <version>\DDL\Data\Quanvert\Museum\qvinfo;
    MR Init MDSC=mrQvDsc"
  SelectQuery = "SELECT age, gender, education, remember
    FROM VDATA _ WHERE gender = {female}"
End InputDataSource
To make the connection string easier to read, line continuation characters have been used to put each property on a separate line, like the original connection string in MyFirstTransfer.dms. For more information, see Breaking up long lines in the DMS file. However, if you prefer you can leave the connection string on one long line.
Some of the connection properties were not in the original connection string that you deleted. This is because you do not need to specify connection properties whose default values are being used.
Setting up the connection string
Now set up the connection string for the OutputDataSource section for the export to the UNICOM Intelligence Data File:
1 Delete the connection string in the OutputDataSource section.
2 Without moving the cursor, choose Connection String Builder from the Tools menu.
The Connection Tab in the Data Link Properties opens (see Data Link Properties: Connection), with the Provider tab set to use the UNICOM Intelligence OLE DB Provider.
3 From the Metadata Type list, select (none).
4 From the Case Data Type list, select UNICOM Intelligence Data File (read-write).
5 Enter the Case Data Location for the new UNICOM Intelligence Data File. Type the name and location of the file, or click Browse.
6 Click the Advanced tab, and then click Allow dirty data. This validates the case data, but accepts data even if it contains some errors and anomalies.
7 Click OK.
This inserts the connection string at the cursor position.
8 Edit the MetadataOutputName parameter in the OutputDataSource section, to give the output metadata file a different name (such as MyFirstTransfer3.mdd) so that when you run the file, the new metadata does not overwrite the metadata that was created for the .sav file in the previous section.
9 Save the file with a new name, such as MyFirstTransfer3.dms.
10 Run MyFirstTransfer3.dms.
You can use similar techniques to set up connection strings for different types of transfer. For more information, see Transferring data using a DMS file.
Next
See
Getting started with Data Management scripting