Data Transformation Engine Functions and Expressions Reference Guide
Chapter 3 - Function Reference FAIL
Functions and Expressions Reference Guide
105
FAIL
The FAIL function returns NONE, aborts the map and returns a text string to be
reported as the map completion error message.
Syntax
FAIL (single-text-expression)
Meaning
FAIL (message_to_return)
Returns
This function returns NONE.
Returns NONE to the output to which the function is assigned, aborts the map,
and returns message_to_return as the map completion error message included
in the execution audit. The map return code will be "30", indicating that the
map failed through the
FAIL function.
Examples
AcctID = EITHER (LOOKUP (CustomerID:.:Xref , MyKey:.:Xref =
ID:.:Input ) ,
FAIL ( "Unknown Customer (" + ID:.:Input + "). Processing
Terminated." ) )
In this example, the FAIL function is being used in conjunction with the
EITHER function to conditionally fail the map if a record in the customer cross-
reference file does not exist for a given CustomerID.
For example, the ID in Input is ABC123. If the
LOOKUP succeeds, the
CustomerID result is assigned to AcctID and the map continues.
If the
LOOKUP fails, AcctID is assigned a value of NONE, the map aborts, and
the message
Unknown Customer (ABC123). Processing Terminated.is
written to the execution audit log.