Specifying the collating sequence

You can use the PROGRAM COLLATING SEQUENCE clause and the ALPHABET clause of the SPECIAL-NAMES paragraph to establish the collating sequence that is used in several operations on alphanumeric items.

These clauses specify the collating sequence for the following operations on alphanumeric items:

  • Comparisons explicitly specified in relation conditions and condition-name conditions
  • HIGH-VALUE and LOW-VALUE settings
  • SEARCH ALL
  • SORT and MERGE unless overridden by a COLLATING SEQUENCE phrase in the SORT or MERGE statement

Example: specifying the collating sequence

The sequence that you use can be based on one of these alphabets:

  • EBCDIC: references the collating sequence associated with the EBCDIC character set
  • NATIVE: references the same collating sequence as EBCDIC
  • STANDARD-1: references the collating sequence associated with the ASCII character set defined by ANSI INCITS X3.4, Coded Character Sets - 7-bit American National Standard Code for Information Interchange (7-bit ASCII)
  • STANDARD-2: references the collating sequence associated with the character set defined by ISO/IEC 646 -- Information technology -- ISO 7-bit coded character set for information interchange, International Reference Version
  • An alteration of the EBCDIC sequence that you define in the SPECIAL-NAMES paragraph

The PROGRAM COLLATING SEQUENCE clause does not affect comparisons that involve national or DBCS operands.