Previous Topic: Numeric ComparisonsNext Topic: Comparisons for Dates, Times, and Timestamps


String Comparisons

The comparison of two strings is determined by the comparison of the corresponding bytes of each string.

If the strings are not the same length, the comparison is made with a temporary copy of the shorter string. The temporary copy is padded on the right with blanks so that it has the same length as the longest string.

Two strings are equal if all corresponding bytes are equal.

If two strings are not equal, their relation is determined by the comparison of the first pair of unequal bytes from the left end of the strings. This comparison is made according to the EBCDIC collating sequence.