Data Transformation Engine Functions and Expressions Reference Guide

Chapter 3 - Function Reference VALID
Functions and Expressions Reference Guide
220
VALID
The VALID function returns the result of the first argument if it is valid; otherwise,
returns the second argument.
Syntax
VALID ( single-text-expressions , single-general-expression )
Meaning
VALID ( function_that_can_fail ,
return_value_if_function_fails )
Returns
This function returns a single-text-expression.
VALID returns the result of the evaluation of function_that_can_fail if it is
valid. If the function fails,
VALID returns return_value_if_function_fails.
The following is the list of functions that can fail:
DBLOOKUP DBQUERY DDEQUERY EXIT
GET PUT RUN
Examples
SomeObject = VALID ( RUN ( "mymap.mmc" , "-OF1 mydata.txt" ) ,
FAIL ( "My RUN failed!" ) )
If the RUN function returns an error return code, the VALID functions returns
NONE, the map aborts and the message "My RUN failed!" will be reported in
the ExecutionSummary of the execution audit log.
Uses
Use VALID to perform conditional processing based on whether an external
interface function executes successfully.
Related Functions
DBLOOKUP, DBQUERY, DDEQUERY