Various operations such as comparisons, sorting, and merging use the collating sequence that is in effect for the program and data items. How you control the collating sequence depends on the code page in effect for the class of the data: alphabetic, alphanumeric, DBCS, or national.
A locale-based collating sequence for items that are class alphabetic, alphanumeric, or DBCS applies only when the COLLSEQ(LOCALE) compiler option is in effect, not when COLLSEQ(BIN) or COLLSEQ(EBCDIC) is in effect. Similarly, a locale-based collating sequence for class national items applies only when the NCOLLSEQ(LOCALE) compiler option is in effect, not when NCOLLSEQ(BIN) is in effect.
If the COLLSEQ(LOCALE) or NCOLLSEQ(LOCALE) compiler option is in effect, the compile-time locale is used for language elements that have syntax or semantic rules that are affected by locale-based collation order, such as:
If the COLLSEQ(LOCALE) compiler option is in effect, the collating sequence for alphanumeric keys in SORT and MERGE statements is always based on the runtime locale.
related tasks
Specifying the collating sequence
Setting sort or merge criteria
Specifying the code page for character data
Using environment variables to specify a locale
Controlling the alphanumeric collating sequence with a locale
Controlling the DBCS collating sequence with a locale
Controlling the national collating sequence with a locale
Accessing the active locale and code-page values
related references
Locales and code pages that are supported
COLLSEQ
NCOLLSEQ