Professional > Data management scripting > Data Management Script (DMS) file > Sections in the DMS file > Event section
 
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 sections.
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).
See Objects in the OnBeforeJobStart Event section.
OnAfterMetaDataTransformation
(See Note below)
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.
See OnAfterMetaDataTransformation Event section
OnJobStart
(See Note below)
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.
See OnJobStart Event section.
OnNextCase
(See Note below)
Defines procedural code that is to be applied to each case. For example, code to clean the case data.
See OnNextCase Event section.
OnBadCase
(See Note below)
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.
See OnBadCase Event section.
OnJobEnd
(See Note below)
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.
See OnJobEnd Event section.
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.
See OnAfterJobEnd Event section.
Note These sections require a metadata source to be specified in the InputDataSource section.
See also
Using objects in the Event sections
Sections in the DMS file