Data Transformation Engine Functions and Expressions Reference Guide
Chapter 3 - Function Reference FAIL
Functions and Expressions Reference Guide
106
Message = VALID (RUN ("Map1Msg.mmc", "-AE –OMMSMQ1B ‘-QN
.\aqueue -CID 2001’" ),
FAIL ("Failure on RUN (" + TEXT (LASTERRORCODE ( )
) + "):" +
LASTERRORMSG ( ) ) )
In this example, the FAIL function is being used in conjunction with the
VALID, LASTERRORCODE, and LASTERRORMSG functions to fail (abort) the map
if the map executed by the
RUN function (Map1Msg.mmc) fails. In this
example, the map fails and returns the error code and error message reported
by the
RUN function using the LASTERRORCODE and LASTERRORMSG functions.
If Map1Msg fails because one or more of its inputs was invalid, Message is
assigned a value of NONE. The map aborts and the message
Failure on RUN
(8): One or more inputs was invalid.is reported in the execution
audit log.
Uses
Use the
FAIL function to abort the map based on map or application specific
logic.
Related Functions
LASTERRORCODE, LASTERRORMSG, VALID