Data Link Properties: MDM Properties
Use the MDM Properties dialog to specify the version, language, context, and label type that you want to use when you connect to a questionnaire definition (.mdd) file.
To open this dialog, click Edit MDM Properties on the Connection tab in the Data Link Properties dialog.
Questionnaire definition (.mdd) files typically contain versions, which record any changes to the content of the questionnaire. Typically, when the questionnaire changes (for example, a question or category is added or deleted), a new version is created and when the changes are complete, the version is locked.
Using a combination of some or all of the versions is useful when, for example, you want to export case data for more than one version and there have been changes to the variable and category definitions that mean that case data collected with one version is not valid in another version. Selecting all of the versions for which you want to export the case data, means that generally you can export the case data collected with the different versions at the same time without encountering validity errors due to the differences between the versions. However, depending on the version changes, some validity errors might still occur.
Current version
Displays an expression that represents the selection you have chosen. You can select the versions you want to use by typing an expression.
Syntax
|
Description
|
..
|
Specifies all versions
|
v1, v2, v3, v4
|
Specifies individual versions
|
v1.. v2
|
Specifies an inclusive range of versions
|
^v1 ..v2
|
Excludes a range of versions
|
|
Specifies the most recent version.
|
You can specify a combination of individual versions, and ranges to include or exclude. For example, the following specifies version 3:2 and all versions from 4:5 to 7:3 with the exception of versions 7 through 7:2:
3:2, 4:5..7:3, ^7..7:2
When there is a conflict between the versions, the order of precedence is taken from the order in which versions are specified in the expression, with the rightmost versions taking precedence over the leftmost. For example, if a category label differs in the versions you select, the text in the version with the higher precedence will be used. However the order of questions and categories is always taken from the most recent version and there is special handling of changes to loop definition ranges and the minimum and maximum values of variables.
For more information, see
Version expressions.
Latest
Select this option if you want to use the most recent version.
All
Select this option if you want to use a combination (superset) of all of the available versions. (This is sometimes called a superversion).
Versions
A list of all of the versions that are available. For each version, the following information is shown:
▪Name: Version names comprise 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); changes in the minor version number indicate that the changes affect only the metadata (for example, a question text has been changed). Version names are created automatically when a version is locked. A version that has not been locked is always called LATEST.
▪Created by: The ID of the user who created the version.
▪Created Date: This shows the date and time at which the version was locked.
▪Description: Information about the version.
Language
Select the language you want to use. You can change the language only if there is more than one language defined.
Context
Select the user context you want to use. The user context controls which texts are displayed. For example, select Question to display question texts, or Analysis to display shorter texts suitable for displaying when analyzing the data.
LabelType
Select the label type you want to use. You should generally select Label.
Version expressions
When you open an MDM Document a metadata (.mdd) file, you can specify the version or versions you want to use. This section describes the syntax that you use to specify the version or versions. This syntax applies to the second parameter of the MDM Document.Open method as well as to the MR Init MDM Version connection properties.
You can specify a single version using its name. Version names combine 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). Version names are created automatically when a version is locked. A version that has not been locked is always called LATEST.
To open the latest minor version that belongs to a specified major version, enter the major version number followed by a colon. For example, if there are minor versions 2:1, 2:2, and 2:3, specifying 2: opens minor version 2:3.
You can use an expression to open a superset (sometimes called a superversion) of two or more versions. The order in which you specify the versions determines the order of precedence that is used when there is a conflict between versions. (The rightmost versions in the expression take precedence over the leftmost.) For example, if a category label differs in the versions you select, the text in the version with the highest precedence is used. However the order of questions and categories is always taken from the most recent version and there is special handling of changes to loop definition ranges and the minimum and maximum values of variables between the versions, similar to that described for the UNICOM Intelligence Metadata Model Version Utility in the master version in a merge operation.
Version expression syntax
{<version> (, <version>)*}<version>::= <version_name> | [^] [<version_name>] .. [<version_name>]
where <version_name> is the name of a major or minor version, and ^ indicates that the following range is to be excluded.
You can specify the name of versions that do not exist in a range. MDM uses the next highest or lowest name it encounters, depending on whether the name is specified at the start or end of the range and whether the range is in ascending or descending sequence.
Examples
{..}
Include all versions in the MDM Document. If there are no versions, this selects the unversioned Document.
{2, 3, 7}
Include versions 2, 3, and 7 and give highest precedence to version 7, the next highest precedence to version 3, and the lowest precedence to version 2.
{5..1}
Include versions 5 through 1, giving the highest precedence to version 1.
{2..7,9}
Include versions 2 through 7 and version 9.
{2..11,^3:1..5:4}
Include versions 2 through 11 but exclude versions 3:1 to 5:4 inclusive.
{}
Include the most recent version in the MDM Document.
{LATEST}
Select the most recent version in the versions collection, whether or not it is named LATEST. If there are no versions, this selects the unversioned document.
{LASTLOCKED}
Include the most recent locked version in the MDM Document.
EBNF definition
The syntax for specifying the version or versions to open can be specified using the following Extended Backus-Naur Form (EBNF), which is a notation for specifying the syntax of a language succinctly and precisely:
<versionname> ::= <version> | (<version_name>:) | <range>
<range> ::= { <range_item>(, <range_item>)* }
<range_item>::= [^]((<version>[..])|([<version>]..[<version>]))
<version> ::= (<vername>[:<version_name>]) | LATEST | LASTLOCKED<version_name> ::= <integer>
Connecting to a relational MR database using RDB DSC 2: Location connection property
When connecting to a relational MR database using RDB DSC 2, you need to specify the Location connection property using an OLE DB connection string. This should specify the parameters shown in the following table.
Parameter
|
Description
|
Provider
|
Set to MSOLEDBSQL.1
|
Integrated Security
|
Set to SSPI
|
Persist Security
|
Set to False
|
Initial Catalog
|
The name of the database.
|
Data Source
|
The name of the server.
|
Here is an example of an OLE DB connection string that connects to the Short Drinks sample database:
Provider=MSOLEDBSQL.1;
Integrated Security=SSPI;
Persist Security Info=False;
Initial Catalog=short_drinks;
Data Source=LocalHost
MR Init Custom connection property
The MR Init Custom connection property can be used to specify whether the connection should favor memory use or speed. The valid settings are:
FavorMemory
Uses server-side cursors so that a single SQL Server connection can be re-used across multiple commands. This mode is slower, but uses less memory (and fewer SQL Server connections) as the number of concurrent commands increases. Use the CursorFetchRows custom property to set the number of rows to fetch. Increasing the number of rows might increase performance.
FavorSpeed
Uses default cursors, requiring a new connection for each command. This mode is considerably faster than the FavorMemory mode, but uses more memory. The FavorSpeed option also optimizes binding look-up by creating a look-up vector. This is the default setting.
MaxCommandsPerConnection
Specifies the maximum number of commands that will share a single case data connection.
By default, all commands open for a project (one command or recordset is created for each active interview) share the same database connection. When interviewing, if there is a high number of concurrent interviews for an individual project, database case date write performance can be impacted due to contention on the database connection. To reduce contention on the database connection, MaxCommandsPerConnection can be set for a project in DPM under Server > Projects > [ProjectName] > mrInterview > MaxCommandsPerConnection. Based on load testing, the suggested property value is 30.
To set this property in the Data Link Properties dialog, select the All tab, and then double-click MR Init Custom. Type the value in the Property Value box, and then click OK.
Complete example
A complete connection string for the Short Drinks sample database. The Data Source property is set to mrRdbDsc2 and the MR Init Custom property is set to favor memory:
Provider=mrOleDB.Provider.2;
Data Source=mrRdbDsc2;
Location="Provider=MSOLEDBSQL.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=short_drinks;Data
Source=LocalHost";Initial Catalog=[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\ Data\Mdd\short_drinks.mdd;
MR Init Project=short_drinks;
MR Init Custom=FavorMemory
In these examples, each connection property is presented on a separate line for clarity. In practice you should specify the connection string without line breaks.
Improving RDB DSC 2 performance
The RDB DSC 2 can use IRowsetFastLoad (improves overall performance) when inserting data into the SQL Server Database. The following code example demonstrates how to enable IRowsetFastLoad via the TransactionMode property. IRowsetFastLoad is enabled when TransactionMode is set to 1.
InputDataSource(myInputDataSource)
ConnectionString = "Provider=mrOleDB.Provider.2; _
Data Source=mrDataFileDsc; _
Location=[Example.ddf]; _
Initial Catalog=[Example.mdd]"
SelectQuery = "SELECT * FROM VDATA"
End
OutputDataSource(myOutputDataSource)
ConnectionString = "Provider=mrOleDB.Provider.2; _
Data Source=mrRdbDsc2; _
Initial Catalog=''; _
MR Init Custom = 'TransactionMode=1'; _
Location='Provider=MSOLEDBSQL.1; _
Integrated Security=SSPI; _
Persist Security Info=False; _
Initial Catalog=[ExampleOutput];
Data Source=LocalHost';
MR Init Project=[ExampleOutput]"
MetaDataOutputName = "[ExampleOutPut.mdd]"
End OutputDataSource
When IRowsetFastLoad is used, the data set is not inserted when an error occurs during the insertion process. If an error does occur, none of the records are transferred to the output data source, and the error that prevented the data transfer is reported after the transfer is complete. The feature is applicable only when transferring data via VDATA.
See also