Data Transformation Engine Functions and Expressions Reference Guide

Chapter 3 - Function Reference GETANDSET
Functions and Expressions Reference Guide
116
GETANDSET
The GETANDSET function gets a fixed length value from the input data stream,
updates that value in the input data stream, and returns either the original or
updated value.
Syntax
GETANDSET (single-fixed-size-item-object-name,
single-item-expression, single-integer-expression)
Meaning
GETANDSET (original_value ,new_value,
integer_that_determines_which_value_to_return)
Returns
This function returns a single-fixed-size-item and replaces the original value in
the input data stream.
GETANDSET updates an input by finding the object represented by
original_value and replacing it with the value represented by the new_value.
The function returns either the original_value or the new_value, depending on
the value of the integer_that_determines_which_value_to_return as follows:
If integer_that_determines_which_value_to_return has the value 1,
original_value is returned.
If integer_that_determines_which_value_to_return has the value 2,
new_value is returned.
If integer_that_determines_which_value_to_return has any other value,
original_value is returned.
If one of the input arguments evaluates to NONE,
GETANDSET returns
NONE.
Note The original value specified for new_value must be a fixed size item. During
map execution, the original value is updated to reflect the evaluation of
GETANDSET. When the source is a file, that file will be updated after map
completion. However, if the source is a database, message, or application, the
content of the source is in memory and the source, itself, is not updated.