Chapter 9. Selecting a collating sequence in Query for iSeries

This chapter describes how you select the collating sequence for your query. The collating sequence is used for certain operations (such as sorting, comparing, and evaluating) that involve SBCS character data in SBCS, DBCS-open, and DBCS-either character fields. A collating sequence assigns a weight to each alphanumeric and special character so that Query knows how to perform operations on character fields and constants.

The collating sequence is only used for SBCS character data in SBCS, DBCS-open, and DBCS-either fields. It is not used for numeric, date, time, timestamp, DBCS-only, DBCS-graphic, or UCS2-graphic data.

Note: To provide the intended effect regardless of the hexadecimal representations of the characters in the data, coded character set identifiers (CCSIDs) are stored with collating sequences when they are saved. For more information about how CCSIDs affect the collating sequence used see “CCSIDs and collating sequences in Query for iSeries” on page 248.

Letting Query for iSeries select a collating sequence

If you did not type a 1 next to the Select collating sequence option on the Define the Query display, Query for iSeries uses the default collating sequence. If you have never saved a collating sequence default value, your collating sequence for new queries is the hexadecimal sequence.

Setting your default collating sequence in Query for iSeries

Generally, you will use the same collating sequence for all of your queries. For most users, the language collating sequence (provided on most systems) is the only one needed. If you select the Select collating sequence option on the Define the Query display when you are creating or changing a query and save your collating sequence option as a default in your query profile, all your queries can use this same collating sequence option without you having to specify it in each query definition. (This does not mean that you must use this same collating sequence for all of your query definitions. It just means that, if you save the collating sequence option as a default, you do not have to select the Select collating sequence option for every query that you create; you have to select it only when a query you are creating requires a different collating sequence.)

After you have selected the collating sequence option that you want on the Select Collating Sequence display, you can save your option as a default value in your query user profile by pressing F23 (Save as default) while you are still viewing the display.

If you decide to define your own collating sequence (option 3 on the Select Collating Sequence display), you can also save your collating sequence (as a default) on the Define Collating Sequence display by pressing F23 while you are still viewing that display. The coded character set identifier (CCSID) of the sequence, assumed from the CCSID of your job, is saved with the profile.

Purpose of a collating sequence in Query for iSeries

A collating sequence determines what characters come before others when operations are performed on character fields for the purpose of:

vSelecting records

vJoining files

vSorting records

vCalculating the minimum and maximum values of a field

vDetermining when a report break occurs

© Copyright IBM Corp. 2000, 2002

111

Page 123
Image 123
IBM SC41-5210-04 Selecting a collating sequence in Query for iSeries, Purpose of a collating sequence in Query for iSeries