Alternate Collating Sequences

You can sort records on EBCDIC, ASCII, or another collating sequence. The default collating sequence is EBCDIC or the PROGRAM COLLATING SEQUENCE you specified in the Configuration Section. You can override the collating sequence named in the PROGRAM COLLATING SEQUENCE by using the COLLATING SEQUENCE phrase of the SORT statement. Consequently, you can use different collating sequences for multiple sorts in your program.

You can also specify the collating sequence that a program will use when it is run, at the time that you compile the ILE COBOL source program. You can specify the collating sequence to be used, through the SRTSEQ and LANGID parameters of the CRTCBLMOD and CRTBNDCBL commands. Refer to Specifying National Language Sort Sequence in CRTCBLMOD for a description of how to specify the collating sequence at compile time. You can override the collating sequence specified at compile time by specifying the PROGRAM COLLATING SEQUENCE clause in the OBJECT-COMPUTER paragraph or by using the COLLATING SEQUENCE phrase of the SORT statement.

When you sort an ASCII file, you have to request the ASCII collating sequence. To do this, use the COLLATING SEQUENCE alphabet-name phrase of the SORT statement, where alphabet-name has been defined in the SPECIAL-NAMES paragraph as STANDARD-1. You can also specify this in the PROGRAM COLLATING SEQUENCE clause of the OBJECT-COMPUTER paragraph if no COLLATING SEQUENCE phrase is specified on the SORT or MERGE statement that overrides it.