Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Controlling the DBCS collating sequence with a locale

The locale-based collating sequence at run time always applies to DBCS data, except for comparisons of literals.

You can use a data item or literal of class DBCS in a relation condition with any relational operator. The other operand must be of class DBCS or class national, or be an alphanumeric group. No distinction is made between DBCS items and edited DBCS items.

When you compare two DBCS operands, the collating sequence is determined by the active locale if the COLLSEQ(LOCALE) compiler option is in effect. Otherwise, the collating sequence is determined by the binary values of the DBCS characters. The PROGRAM COLLATING SEQUENCE clause has no effect on comparisons that involve data items or literals of class DBCS.

When you compare a DBCS item to a national item, the DBCS operand is treated as if it were moved to an elementary national item of the same length as the DBCS operand. The DBCS characters are converted to national representation, and the comparison proceeds with two national character operands.

When you compare a DBCS item to an alphanumeric group, no conversion or editing is done. The comparison proceeds as for two alphanumeric character operands. The comparison operates on bytes of data without regard to data representation.

related tasks
Specifying the collating sequence
Using DBCS literals
Controlling the collating sequence with a locale
Controlling the alphanumeric collating sequence with a locale
Controlling the national collating sequence with a locale

related references
COLLSEQ
Classes and categories of data (COBOL for Windows Language Reference)
Alphanumeric comparisons (COBOL for Windows Language Reference)
DBCS comparisons (COBOL for Windows Language Reference)
Group comparisons (COBOL for Windows Language Reference)


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)