Data Transformation Engine Functions and Expressions Reference Guide

Chapter 3 - Function Reference GETANDSET
Functions and Expressions Reference Guide
117
Note This function does not support decrementing integers past 0 into negative
numbers.
Example
New Tracking# = GETANDSET (Tracking#:Card, Tracking#:Card + 3,
1)
This rule finds the object Tracking#:Card (assume that it has the value 6),
adds 3 to it, giving 9, and replaces the 6 with the 9 in the data location of
Tracking#:Card. Subsequent references to Tracking#:Card will find its value
to be 9. If Card is an input card whose source is a file, the file is rewritten with
the new value.
Because the third input argument
(integer_that_determines_which_value_to_return) is 1, the returned value is
the original value of 6.
Uses
Use
GETANDSET when you have an input file that keeps track of control
information that serves as an input to your map and the control information in
the file needs to be updated based on processing that occurs in your map.