Desktop User Guides > Professional > Data management scripting > Merging case data > Using a DMS script to merge data > Specifying the files that you want to merge
Specifying the files that you want to merge
To specify the case data files that you want to merge, add an InputDataSource section to your DMS script for each case data file. For example, to merge three case data files, you must add three InputDataSource sections. You must also add an OutputDataSource section to the DMS script to specify the data source to which the merged data will be output.
Before writing the InputDataSource sections, note the following:
The first InputDataSource section defines the master data source, the second InputDataSource section defines the second data source, and so on.
The master data source must use the UNICOM Intelligence OLE DB Provider and must include a metadata source. This can be either a metadata document (.mdd) file or a proprietary metadata file for which a read-enabled MDSC is available.
All input data sources will be opened with the value of the MR Init Category Names connection property set to 1. This means that category names will be read from the input data sources instead of category values. This is done because the same category value could have been assigned to a different category name in each data source.
By default, the most recent versions of the input metadata sources will be merged. However, if an input metadata source contains multiple versions, you can specify a version or combination of versions to be input to the merge by setting the MR Init MDM Version connection property in the relevant InputDataSource section.
You can specify the UseInputAsOutput option in one of the InputDataSource sections, in which case you do not need an OutputDataSource section in your DMS script. If you are using the UNICOM Intelligence Data Model to read the case data, you can specify the UseInputAsOutput option only if the CDSC for that data source supports the updating of existing records. You must also set the MR Init MDM Access connection property to 1 in the InputDataSource section to open the data source for read/write access or when operating in validation mode.
When you use the UseInputAsOutput option, the version history in the input metadata will be preserved only if, by default, you are using the most recent version. A new unlocked version will be created if the most recent version is locked. However, if you specify one or more versions using the MR Init MDM Version connection property in the InputDataSource section, the version history will be deleted.
You can use a select query that returns no records (for example, ‘select * from vdata where false’) to avoid processing case data for the UseInputAsOutput data source. This is useful when merging new case data to an existing dataset.
Warning: The UseInputAsOutput option should always be used with caution because it will change the metadata and case data irreversibly for that data source. It is not suitable for use with data that is in the process of the being collected by a live UNICOM Intelligence Interviewer - Server project. It is recommended that you take a backup of your data before using this option.
Before writing the OutputDataSource section, note the following:
The output metadata will not contain any versions, even if one or more input metadata sources contains versions.
You cannot write case data to any of the Microsoft Office file formats when running a merge.
Using a DMS script to merge data