About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
Last updated: Feb 11, 2025
Comparison functions are used to compare field values to each other or to a specified string.
For example, you can check strings for equality using
. An
example of string equality verification is: =
.Class = "class 1"
For purposes of numeric comparison, greater means closer to positive infinity, and lesser means closer to negative infinity. That is, all negative numbers are less than any positive number.
Function | Result | Description |
---|---|---|
|
Integer | Returns the number of values from a list of fields that are equal to ITEM1 or null if ITEM1 is null. |
|
Integer | Returns the number of values from a list of fields that are greater than ITEM1 or null if ITEM1 is null. |
|
Integer | Returns the number of values from a list of fields that are less than ITEM1 or null if ITEM1 is null. |
|
Integer | Returns the number of values from a list of fields that aren't equal to ITEM1 or null if ITEM1 is null. |
|
Integer | Returns the number of null values from a list of fields. |
|
Integer | Returns the number of non-null values from a list of fields. |
|
Boolean | Used to check the ordering of date values. Returns a true value if DATE1 is before DATE2. |
|
Integer | Returns the index of the first field containing ITEM from a LIST of fields or 0 if the value isn't found. Supported for string, integer, and real types only. |
|
Any | Returns the first non-null value in the supplied list of fields. All storage types supported. |
|
Integer | Returns the index of the first field in the specified LIST containing a non-null value or 0 if all values are null. All storage types are supported. |
|
Boolean | Returns true for records where ITEM1 is equal to ITEM2. |
|
Boolean | Returns true if the two strings are not identical or 0 if they're identical. |
|
Boolean | Returns true for records where ITEM1 is less than ITEM2. |
|
Boolean | Returns true for records where ITEM1 is less than or equal to ITEM2. |
|
Boolean | Returns true for records where ITEM1 is greater than ITEM2. |
|
Boolean | Returns true for records where ITEM1 is greater than or equal to ITEM2. |
|
Integer | Returns the index of the last field containing ITEM from a LIST of fields or 0 if the value isn't found. Supported for string, integer, and real types only. |
|
Any | Returns the last non-null value in the supplied list of fields. All storage types supported. |
|
Integer | Returns the index of the last field in the specified LIST containing a non-null value or 0 if all values are null. All storage types are supported. |
|
Any | Returns the greater of the two items: ITEM1 or ITEM2. |
|
Integer | Returns the index of the field containing the maximum value from a list of numeric fields or 0 if all values are null. For example, if the third field listed contains the maximum, the index value 3 is returned. If multiple fields contain the maximum value, the one listed first (leftmost) is returned. |
|
Number | Returns the maximum value from a list of numeric fields or null if all of the field values are null. |
|
Boolean | Returns true if ITEM is a member of the specified LIST. Otherwise, a false value is returned. A list of field names can also be specified. |
|
Any | Returns the lesser of the two items: ITEM1 or ITEM2. |
|
Integer | Returns the index of the field containing the minimum value from a list of numeric fields or 0 if all values are null. For example, if the third field listed contains the minimum, the index value 3 is returned. If multiple fields contain the minimum value, the one listed first (leftmost) is returned. |
|
Number | Returns the minimum value from a list of numeric fields or null if all of the field values are null. |
|
Boolean | Used to check the ordering of time values. Returns a true value if TIME1 is before TIME2. |
|
Returns the value of each listed field at offset INT or NULL if the offset is outside the range of valid values (that is, less than 1 or greater than the number of listed fields). All storage types supported. |
Was the topic helpful?
0/1000