Desktop User Guides > Professional > Data management scripting > Getting started with Data Management scripting > 9. Getting to know the samples
 
9. Getting to know the samples
The UNICOM Intelligence Developer Documentation Library includes some sample DMS files that demonstrate common data management tasks. Most of these sample files run on the sample data that is in the UNICOM Intelligence Developer Documentation Library without any changes. However, if you did a custom installation, you might need to change the file locations that are specified in the samples before you run them. Some of the samples require other software (for example, Microsoft Word) to be installed as well.
The sample DMS files are in these groups:
Sample DMS files: These demonstrate basic features like transferring data to and from various data formats, cleaning data, setting up weighting, creating new variables, using the Metadata Model to Quantum component to set up card, column, and punch definitions, and so on.
Sample DMS files for exporting UNICOM Intelligence Interviewer data: These samples demonstrate exporting UNICOM Intelligence Interviewer - Server data that has been collected using multiple questionnaire versions. All of these samples use the Short Drinks sample database, but they can be changed to run with any multiversion project. You need access to a SQL Server installation and appropriate user access rights to run these samples. You must also restore the Short Drinks sample. For more information, see Restoring the Short Drinks sample database.
Sample DMS files that integrate with Microsoft Office: These demonstrate advanced features, such as transferring data from an Access database, setting up tables and charts in Excel and topline tables in Word.
Table scripting sample Data Management scripts: These provide some examples of scripting tables in a DMS file. To run these examples, UNICOM Intelligence Professional Tables Option must be installed. Some of the examples have additional requirements.
Sample DMS include files: These are Include files that can be reused in other DMS files.
You can use the sample DMS files as a starting point when you develop your own DMS files. Work on a copy of the samples rather than the samples themselves: copy the entire folder to another location on your computer, and then work on the copies in the new location. This means you avoid losing your work when you uninstall or upgrade the UNICOM Intelligence Developer Documentation Library, and you can refer to the original samples when necessary.
Some of the sample files use the Include file and text substitution features. Before you look at the samples, see:
Using include files in the DMS file
Using text substitution in the DMS file
Start by studying the lists of sample files and make a list of which ones seem most relevant to your work. For each of the samples on your list, do the following:
1 Open the sample in UNICOM Intelligence Professional. Look at each section, and then try to work out what it means. Refer to the relevant parts of the documentation.
2 If the sample uses one or more Include files and/or text substitutions, use the /a: and /norun options in DMS Runner to save the expanded file. For example, if you change the path in the command prompt to the folder where the sample DMS files are installed, you could use the following command to save the expanded MDM2QuantumExtra.dms sample to a file called MyExpanded.dms, without running it:
DMSRun MDM2QuantumExtra.dms /a:MyExpanded.dms /norun
3 Open the expanded file in UNICOM Intelligence Professional and study it. The expanded file shows the file as UNICOM Intelligence Professional and DMS Runner “see” it after all of the text substitutions and Include files have been implemented. The line numbers shown in error messages always refer to the line numbers in the expanded file. Any comments that appear between the sections in the original do not appear in the expanded file.
4 Use UNICOM Intelligence Professional or DMS Runner (see DMS Runner) to run the sample on the sample data.
5 Study the output of the transformation. How you do this depends on the type of output. For example, examine report, log, and error files in a text editor. For output data types that can be read by the UNICOM Intelligence Data Model, you could open the relevant output files in UNICOM Intelligence Interviewer - Paper or UNICOM Intelligence Reporter - Survey Tabulation. Alternatively, you could use DM Query to look at the case data and MDM Explorer to look at the metadata.
6 Try changing a copy of the sample to run on your own data. However, do not use any of the features (such as update queries in the InputDataSource section or the UseInputAsOutput feature) that actually change the input data until you are sure that is what you want to do.
The UNICOM Intelligence Developer Documentation Library also includes the executable file and Visual Basic .NET source code for WinDMSRun, which you can use to set up and run simple DMS files: see WinDMSRun. If you want to develop applications that use the Data Management Object Model (DMOM), you can use the source code as a reference. For more information, see WinDMSRun as programmer’s reference.
Next
10. Finding more information about data management scripting
See
Getting started with Data Management scripting