Function Reference > Functions > SETMAXVARIABLE


Sets the current value of an in-out parameter to the higher of two values: the current value of the parameter or the value you specify. Returns the new current value.
At the end of a task session, Data Integration saves the final current value and writes it to the job details. Unless overridden, it uses the saved value as the initial value of the parameter for the next task session.
When used with a string in-out parameter, SETMAXVARIABLE returns the higher string based on the sort order selected in the mapping.
Use the SETMAXVARIABLE function only once for each in-out parameter in a pipeline. Data Integration processes in-out parameters as it encounters them in a mapping. The order in which Data Integration encounters variable functions in the mapping might not be the same for every task session. This could cause inconsistent results if you use the same variable function multiple times in a mapping.
You can use SETMAXVARIABLE with the Expression transformation.


SETMAXVARIABLE( $$Variable, value )
$$ Variable
Name of the in-out parameter you want to set. Use in-out parameters with Max aggregation type.
The value you want Data Integration to compare against the current value of the in-out parameter. You can enter any valid transformation expression that evaluates to a data type compatible with the data type of the parameter.

Return Value

The higher of two values: the current value of the in-out parameter or the value you specified. The return value is the new current value of the parameter.
When value is NULL Data Integration returns the current value of $$Variable.