ILE COBOL Programmer's Guide


Specifying National Language Sort Sequence in CRTCBLMOD

At the time that you compile your ILE COBOL source program, you can explicitly specify the collating sequence that the program will use when it is run, or you can specify how the collating sequence is to be determined when the program is run.

To specify the collating sequence, you first define an alphabet-name in the SPECIAL-NAMES paragraph using the ALPHABET clause and associate that alphabet-name with the NLSSORT implementor name. Then, refer to this alphabet-name in the PROGRAM COLLATING SEQUENCE clause in the ENVIRONMENT DIVISION, or in the COLLATING SEQUENCE phrase in the SORT/MERGE statements, to denote that the specified alphabet-name will determine the collating sequence to be used.

You specify the actual collating sequence used, through the options of the SRTSEQ and LANGID parameters of the CRTCBLMOD and CRTBNDCBL commands. For example, if you specify SRTSEQ(*JOBRUN) and LANGID(*JOBRUN), the collating sequence of the program will be resolved at run time. This value allows the source program to be compiled once and used with different collating sequences at run time. The PROCESS statement options associated with SRTSEQ and LANGID may also be used to specify the collating sequence (see Using the PROCESS Statement to Specify Compiler Options).

If your source program does not have NLSSORT associated with an alphabet-name in its ALPHABET clause, or has an ALPHABET clause specifying NLSSORT but the associated alphabet-name is not referred to in any PROGRAM COLLATING SEQUENCE clause or COLLATING SEQUENCE phrase of SORT/MERGE statements, then the sort sequence identified by the SRTSEQ and LANGID parameters is not used.

The alphabet-name associated with NLSSORT cannot be used to determine character code set, as in the CODE-SET clause of the File Description (FD) entry. The alphabet-name used to determine character code set must be identified in a separate ALPHABET clause.

Refer to the WebSphere Development Studio: ILE COBOL Reference for a full description of the ALPHABET clause, PROGRAM COLLATING SEQUENCE clause, and SORT/MERGE statements. Refer to Parameters of the CRTCBLMOD Command for a description of the SRTSEQ and LANGID parameters.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]