Event section
The Event section defines procedural code for cleaning case data, setting up weighting, setting up case data for derived variables, creating batch tables, and so on. The Event section is optional and there can be more than one Event section in a DMS file. The code must be written in mrScriptBasic.
Each Event section can contain any number of functions and subroutines and can access any of the registered objects. The objects that are registered vary according to the section. Objects in other object models can be accessed using the
CreateObject function. See
Using objects in the Event section.
Syntax
Event(<name> [, "<description>"])
...
End Event
Parameters
name and description must be of type Text and name must be a recognized Event section name, which defines when the processing will take place. The recognized names are:
OnBeforeJobStart
Defines procedural code that is to be executed before any of the data sources are opened. For example, code that uses the Metadata Model to Quantum component to set up card, column, and punch specifications for use when exporting case data to a Quantum-format .dat file, or code that creates an .mdd file from proprietary metadata.
After the OnBeforeJobStart event, the metadata file that is specified in the input data source is loaded in preparation for creating dmgrQuestions (which are created before any event except the OnBeforeJobStart event).
OnAfterMetaDataTransformation
Defines procedural code that is to be executed after any metadata defined in a Metadata section has been merged with the input metadata. Typically this is used to set up card, column, and punch definitions for variables defined in the Metadata section.
OnJobStart
Defines procedural code that is to be executed after all of the data sources have been opened and before the processing of the first case begins. For example, code to set up global variables that are used in the OnNextCase, OnBadCase, and OnJobEnd Event sections.
OnNextCase
Defines procedural code that is to be applied to each case. For example, code to clean the case data.
OnBadCase
Defines procedural code that is to be executed for each record that will not be transferred because it has failed the validation. Typically used to create a report of bad cases.
OnJobEnd
Defines procedural code that is to be executed after all of the processing of the individual cases has been completed and before the data sources are closed. For example, code that closes report files, or uses the Weight component to set up weighting in the output data source.
OnAfterJobEnd
Defines procedural code that is to be executed after the data source connections are closed. For example, code to create tables or launch a report file.
These sections require a metadata source to be specified in the InputDataSource section.
See