The collating sequence for single-byte alphanumeric characters for the program collating sequence is based on either the locale at compile time or the locale at run time.
If you specify PROGRAM COLLATING SEQUENCE in the source program, the collating sequence is set at compile time and is used regardless of the locale at run time. If instead you set the collating sequence by using the COLLSEQ compiler option, the locale at run time takes precedence.
If the code page in effect is a single-byte ASCII code page, you can specify the following clauses in the SPECIAL-NAMES paragraph:
If you specify these clauses when the source code page in effect includes DBCS characters, the clauses will be diagnosed and treated as comments. The rules of the COBOL user-defined alphabet-name and symbolic characters assume a character-by-character collating sequence, not a collating sequence that depends on a sequence of multiple characters.
If you specify the PROGRAM COLLATING SEQUENCE clause in the OBJECT-COMPUTER paragraph, the collating sequence that is associated with the alphabet-name is used to determine the truth value of alphanumeric comparisons. The PROGRAM COLLATING SEQUENCE clause also applies to sort and merge keys of USAGE DISPLAY unless you specify the COLLATING SEQUENCE phrase in the SORT or MERGE statement.
If you do not specify the COLLATING SEQUENCE phrase or the PROGRAM COLLATING SEQUENCE clause, the collating sequence in effect is NATIVE by default, and it is based on the active locale setting. This setting applies to SORT and MERGE statements and to the program collating sequence.
The collating sequence affects the processing of the following items:
related tasks
Specifying the collating sequence
Controlling the collating sequence with a locale
Controlling the DBCS collating sequence with a locale
Controlling the national collating sequence with a locale
Setting sort or merge criteria
related references
COLLSEQ
Classes and categories of data
(COBOL for Windows Language Reference)
Alphanumeric comparisons
(COBOL for Windows Language Reference)