Desktop User Guides > Professional > Data management scripting > Working with UNICOM Intelligence Interviewer - Server data > Selecting a specific version
 
Selecting a specific version
When you transfer UNICOM Intelligence Interviewer - Server data using a DMS file, by default the most recent version of the metadata is used and the export includes case data for all versions. However, you can select a specific version of the metadata to be used and it is easy to set up a filter to restrict the transfer to records that were collected using one or more specified versions.
Version names are made up of a combination of the major version and minor version numbers in the form Major#:Minor#, where Major# is the number of the major version and Minor# is the number of the minor version. Changes in the major version number indicate that the structure of the case data has changed (for example, variables or categories have been added or deleted) whereas changes in the minor version number indicate that the changes affect the metadata only (for example, a question text has been changed). This means that it is generally safe to export data collected using a major version and all of its associated minor versions simultaneously.
Version names are created automatically when a version is locked. A version that has not been locked is always called LATEST.
Specifying a metadata version to use
You specify the version of the metadata to be used in the transfer using the MR Init MDM Version connection property in the connection string in the InputDataSource section.
If you are using the Data Link Properties dialog to set up the connection string (for example, because you are using the Connection String Builder or WinDMSRun) click the Properties button in the Metadata section on the Connection tab. This opens the Metadata Properties dialog, in which you can select the version you want to use from the Version list box.
When you select a specific version for the transfer, the output metadata will be based on that version only and will not contain the previous versions. When you do not specify a version to use, the most recent version of the metadata is automatically used and the output metadata will contain all of the versions that exist in the input metadata.
Filtering on a specific version
When you want to restrict a transfer to case data records that were collected using a specific version of the metadata, you filter using the DataCollection.MetadataVersionNumber system variable. You can include the case data for a major version and all of its minor versions by using the LIKE keyword and the % wildcard character.
Example
This example selects version 2 of the metadata and case data collected with this version and all of its minor versions. (The Short Drinks sample does not actually contain any minor versions.)
InputDatasource(mrInterviewData)
  ConnectionString = "Provider=mrOleDB.Provider.2; _
    Data Source=mrRdbDsc2; _
    Initial Catalog=C:\Program Files\IBM\SPSS\DataCollection\7\
        DDL\Data\Mdd\short_drinks.mdd; _
    Location="Provider=MSOLEDBSQL.1; _
      Integrated Security=SSPI; _
      Persist Security Info=False; _
      Initial Catalog=short_drinks; _
      Data Source=LocalHost"; _
    MR Init MDM Version=2; _
    MR Init Project=short_drinks"
  SelectQuery = "SELECT * FROM vdata _
    WHERE (DataCollection.MetadataVersionNumber =’2’ _
    OR DataCollection.MetadataVersionNumber LIKE ’2:%’) _
    AND (ContainsAny(DataCollection.Status, {completed})) _
    AND NOT (DataCollection.Status >= {test})"
End InputDatasource
This example is in the mrInterviewOneVersionToSav.dms sample: see Sample DMS files for exporting UNICOM Intelligence Interviewer data.
See
Working with UNICOM Intelligence Interviewer - Server data