In a relation condition a national data item may be compared with operands of various classes. In this case, data item contents can also be converted implicitly to the corresponding national representation.
For this comparison, non-national operands are treated as if they had been moved to a national data item of the same size using MOVE. The national data is then compared. To do this, the shorter operand is filled on the right with national blanks up to the length of the longer operand.
Example 12-16
01 num PIC 9(4) VALUE 1860. 01 alfa VALUE "TSV MÜNCHEN". 01 nat. 02 nat1 PIC NNN VALUE N"TSV". 02 nat2 PIC NNNN VALUE N"1860". IF num = nat2 THEN ... (1) IF alfa = nat1 THEN ... (2)
(1) The numeric field num is moved to a 4-character long national relational item ein (defined as NNNN) and compared with nat2. The comparison is true.
(2) The alphanumeric item alfa is converted to a national relational item (defined as N(11)). This is compared with a relational item (also defined as N(11), whose content corresponds to nat1 supplemented by 8 national blanks).
The comparison is false.
Individual national characters are always compared on the basis of the binary representation of these characters. This also applies for the SORT and MERGE statements. The extended options in the case of a comparison in accordance with Unicode are not supported (culturally sensitive, normalization).
It must also be borne in mind that a relation operation which exists between 2 alphanumeric characters need not exist in precisely the same form between the two corresponding national characters (e.g. "A" < "1", but N"A" > N"1").