Scripting > mrScriptBasic overview > mrScriptBasic examples > 5: Creating Quancept script and mrScriptMetadata from an .mdd file
 
5: Creating Quancept script and mrScriptMetadata from an .mdd file
This example is designed to be run in mrScript Command Line Runner using the /m: option to specify an .mdd file. When you use the /m: option in this way, the MDM Document is automatically available to the script as an intrinsic variable called MDM.
This example uses the DSC Registration component to get access to the Quancept MDSC, which is then used to create a Quancept script file from an .mdd file. The Quancept script file is called MyQCScript.qqc and is created in the folder in which the mrScript Command Line Runner is installed. By default, this is [INSTALL_FOLDER]\IBM\SPSS\DataCollection\<version>\Accessories.
Dim mrDSCs, mrMdsc

' Create the DSCReg object
Set mrDSCs = CreateObject("MRDSCReg.Components")

' Get the Quancept MDSC
Set mrMdsc = mrDSCs.Item["mrQCDsc"]

' Save the Quancept Script
mrMdsc.Metadata.Save(MDM2, _
  "C:\Program Files\IBM\SPSS\DataCollection\7\DDL\Output\MyQCScript.qqc", _
   Null)
You could use similar code to access the mrScript MDSC and create an mrScriptMetadata file from the .mdd file. For example:
Dim mrDSCs, mrMdsc

' Create the DSCReg object
Set mrDSCs = CreateObject("MRDSCReg.Components")

' Get the mrScript MDSC
Set mrMdsc = mrDSCs.Item["mrScriptMDsc"]

' Save the mrScriptMetadata
mrMdsc.Metadata.Save(MDM2, _
"C:\Program Files\IBM\SPSS\DataCollection\7\DDL\Output\mrScriptMetadata.ivs", _
Null)
These examples are included with the UNICOM Intelligence Developer Documentation Library as two sample scripts called ExportToQuancept.mrs and ExportTomrScriptMetadata.mrs. See Sample mrScriptBasic files for more information.
See also
mrScriptBasic examples