Data Transformation Engine Functions and Expressions Reference Guide
Chapter 3 - Function Reference ISERROR
Functions and Expressions Reference Guide
133
ISERROR
The ISERROR function tests an object to see if it is in error.
Syntax
ISERROR (single-object-name)
Meaning
ISERROR (object_to_test)
Returns
This function returns TRUE or FALSE
Returns TRUE if object_to_test is in error.
Returns FALSE if object_to_test is completely valid.
Examples
InfoRec (s) = IF ( ISERROR ( Record:SomeFile ), "Bad --> " +
REJECT ( Record:SomeFile ), "Ok --> " + TEXT (
Record:SomeFile ) )
In this example, ISERROR is used to produce a report for all Record objects in
SomeFile. If the record is in error, the InfoRec will have the text Bad -->
followed by the data from the input Record. If the record is valid, the InfoRec
will have the text Ok --> followed by the data from the input Record, such as:
Ok --> SZ-68839,486 Upgrade Microprocessor,186.86,100,W200
Bad --> MK-19309,,369.43,417,W100
Ok --> KL-20349,PCMCIA Network Adaptor,174.82,29,N300
Ok --> WP-37679,AC Adaptor,39.48,245,E100
Bad --> IL-39890,8MB Memory PCMCIA,390.48,0,S100
Uses
Use
ISERROR to output your data in exactly the same order as it occurs in your
input, both the valid data and the data in error. Or, use
ISERROR to produce
error messages for bad data in the same file in which you map your good data.
Related Functions
CONTAINSERRORS