Data Model > UNICOM Intelligence Data Model samples > Sample scripts > Topline samples
 
Topline samples
You can use the MSWordAndIEToplines.mrs and MSWordAndIEToplinesRDB.mrs samples to set up in Word and HTML topline tables for all the simple categorical questions in a survey.
The MSWordAndIEToplines.mrs sample uses user-defined constants to specify all file names and locations, so that it is easy to change these samples to run on your own data. If you open the sample in a text editor, you will see the following constants are defined:
OUTPUTFOLDER
The folder where the topline summary files will be created. Make sure that this is a valid location for your system.
MYDATASOURCE
The CDSC that is being used to read the case data.
MYCASEDATA
The location of the case data.
MYMETADATA
The location of the metadata. This must be an .mdd file. If you want to run the sample on proprietary metadata, you need to create an .mdd file from the metadata first. You can do this by opening the metadata in MDM Explorer using the Open mDSC command and then using the Save As command to save the metadata as an .mdd file.
MYPROJECT
The name of the project. This is used only by RDB DSC and should be set to an empty string for all other case data types.
MYPROJECTNAME
A "user-friendly" name for the project. This is used in the report title.
Examples
Here is an example of the constants set up to read the Museum sample Quanvert database:
Const OUTPUTFOLDER = "[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Output\"
Const MYDATASOURCE = "mrQvDsc"
Const MYCASEDATA = "[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Data\Quanvert\Museum\qvinfo"
Const MYMETADATA = "[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Data\Quanvert\Museum\museum.mdd"
Const MYPROJECT = ""
Const MYPROJECTNAME = "Museum"
Here is an example of the constants set up to read the Employee Data sample .sav file:
Const OUTPUTFOLDER = "[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Output\"
Const MYDATASOURCE = "mrSavDsc"
Const MYCASEDATA = "[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Data\Sav\Employee data.sav"
Const MYMETADATA = "[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Data\Sav\Employee data.mdd"
Const MYPROJECT = ""
Const MYPROJECTNAME = "Employee Data"
The MSWordAndIEToplinesRDB.mrs sample has been provided as an example of running the sample on data stored in a relational MR database using RDB DSC 2. When you use RDB DSC 2, you specify the Location connection property as an OLE DB connection string, which must be enclosed in quotation marks (" "). For more information, see Connecting to a relational MR database using RDB DSC 2. Note that when you set up the connection string, you need to escape each quotation mark with a second quotation mark. The MSWordAndIEToplinesRDB.mrs sample shows you how to do this.
You can use the MSPowerPointCharts.mrs sample to set up similar topline summaries in the form of PowerPoint charts.
Additional samples for creating topline summaries (for example in Excel) are provided in the form of sample DMS files. You need UNICOM Intelligence Professional to run these samples. However, some of the samples can easily be adapted to be run as .mrs files without UNICOM Intelligence Professional. For more information, see Sample DMS files that integrate with Microsoft Office.
Running the mrScriptBasic samples
1 Open a Command Prompt. For example, from the Windows Start menu, choose Programs > Accessories > Command Prompt
2 Change to the folder in which the .mrs file is located. This is typically the [INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Scripts\General\mrScriptBasic folder.
3 Type mrscriptcl followed by the name of the file you want to run and the options you require. For more information, see mrScript Command Line Runner.
Alternatively, if you have UNICOM Intelligence Professional, you can run the mrScriptBasic samples in it.
For information about the specific requirements of each sample, see Sample mrScriptBasic files.
See also
Sample mrScriptBasic files
mrScriptBasic examples
mrScriptBasic overview
mrScript Command Line Runner
Sample scripts