The TERMINATE function instructs the Integration Engine to close/disconnect all datastores and stop processing with a user specified return code. For transaction based datastores, a commit is issued if zero is specified for the return code. If anything else is specified, a rollback is issued.
This function is most useful for debugging a script. It is possible to stop the engine on a specific record or after a certain condition is met.
Category
Specialized
Syntax
TERMINATE(*number)*
Parameter and Description
Parameter | Description |
---|---|
number | Numeric return code to terminate the engine with. If the parameter is not numeric, the engine will end with return code 8. |
Example
TERMINATE with return code zero on a specific record.
IF (SOURCE.KEY = '123456789')
{
TERMINATE(0)
}
TERMINATE with return code zero on the first record with a certain field value.
IF (SOURCE.FIELD = 'X')
{
TERMINATE(0)
}
TERMINATE with return code 8 after 5 records.
IF (V_COUNT = 5)
{
TERMINATE(8)
}