Locale
A locale defines your cultural environment. Specifying the correct locale ensures that Db2 handles case conversions and sorts according to the rules for a particular language.
You can set the locale for your subsystem by using the CURRENT LOCALE LC_CTYPE special register. Alternatively, you can specify a locale when you perform specific functions that depend on locale, such as UPPER and LOWER.
Depending on the encoding scheme of the data, use one of the following locale formats:
- LE locales
- Specify this locale format for EBCDIC data.
An LE locale consists of two components: the first component represents a specific language and country, and the second component is a CCSID. For example, in the locale Fr_CA.IBM®-1047, Fr_CA represents the language and country (French Canadian), and IBM-1047 is the associated CCSID.
When you specify an LE locale to Db2 for z/OS®, specify only the first component, which is the language and country. Db2 appends "IBM-" and the CCSID.
The following table shows some example LE locales that you can specify to Db2.
Table 1. Examples of LE locales that you can specify Locale Language Country En_US English United States De_CH German Switzerland De_DE German Germany Fr_CA French Canada It_IT Italian Italy Ja_JP Japanese Japan For a complete list of supported LE locales, see Compiled locales (LE locales).
- z/OS Unicode Services
- Specify one of the following z/OS Unicode Services locale
formats for ASCII and Unicode data.
- Locale format for case conversion services
- Use this format when you need a locale to affect how data is converted
to uppercase and lowercase, such as in the UPPER and LOWER functions.
The locale format for case conversion is Lxx_Ryy where:
- Lxx
- Language
- Ryy
- Region
You can use any of the locale values that are supported by z/OS Unicode Services for CUNBAPRM_Locale (31-bit) or CUN4BAPR_Locale (64-bit). The following table lists some example locale values for case conversion services.
Table 2. Example locale values for the case conversion services of z/OS Unicode Services Locale value Language Region Cs_CZ Czech Czech Republic De_DE German Germany En_US English United States En_GB English Great Britain Es_MX Spanish Mexico Fr_FR French France Ja_JP Japanese Japan Sv_SE Swedish Sweden For a complete list of supported locales for case conversion services, see Locales supported for case service .
- Locale format for collation conversion services
- Use this format when you need a locale to affect how the data
is sorted.
The collation locale format is Lxx_Ryy_Vzz where:
- Lxx
- Language
- Ryy
- Region
- Vzz
- Variant
You can use any of the locale values that are supported by z/OS Unicode Services for CUNBOPRM_Collation_Keyword/CUN4BOPR_Collation_Keyword The following table lists some example locale values for collation
Table 3. Example locale values for collation conversions in z/OS Unicode Services Locale value Language Region Variant LCS_RCZ Czech Czech Republic None LDE_RDE German Germany None LDE_RDE_PREEURO German Germany Pre Euro support LEN English None None LEN_RGB English Great Britain None LES_RMX Spanish Mexico None LFR_RFR French France None LJA Japanese None None LSV Swedish None None For a complete list of supported locales for collation conversion services, see Locales supported for collation .