Performs an inequality comparison on elements of two dynamic arrays.
function (not equals) compares each corresponding numeric element from two dynamic arrays for inequality. It returns a dynamic array of boolean values, in which each element comparison is represented by a 1 (not equal) or a 0 (equal). NES
removes signs and leading and trailing zeros from element values before making the comparison. If an element is missing, or has a null string or non-numeric value, NES
assigns it a value of 0 for the purpose of this comparison.
For two elements to be compared, they must be on the same dynamic array level. For example, you cannot compare a value mark (@VM) dynamic array element to a subvalue mark (@SM) dynamic array element.
If the two dynamic arrays have different numbers of elements, the returned dynamic array has the number of elements of the longer dynamic array. By default, unmatched elements return 1 (not equal). That is, the NES
comparison of each element in the longer dynamic array that has no corresponding element in the shorter dynamic array always returns 1 (not equal), even when the value of the longer array element is 0 or the null string, or is a missing element within the dynamic array. You can also use the REUSE
function to define behavior when specifying two dynamic arrays with different numbers of elements.
function is the functional opposite of the EQS
The following example uses the NES
function to return a not equals comparison for each of the elements in dynamic arrays a
! returns 0ý1ý1ý0
© 1997-2019 InterSystems Corporation, Cambridge, MA