CURRENT LOCALE LC_CTYPE special register
CURRENT LOCALE LC_CTYPE specifies the LC_CTYPE locale that will be used to execute SQL statements that use a built-in function that references a locale. Functions LCASE, UCASE, and TRANSLATE (with a single argument) refer to the locale when they are executed.
The data type is CHAR(50). If necessary, the value is padded on the right with blanks so that its length is 50 bytes. The following values are supported:
- blank
- For a conversion to lowercase, SBCS uppercase characters A-Z are converted to SBCS lowercase characters a-z, and characters with diacritical marks are not converted. If the string contains MIXED or DBCS characters, full-width Latin uppercase characters A-Z are converted to full-width lowercase characters a-z.
For a conversion to uppercase, SBCS lowercase characters a-z are converted to SBCS uppercase characters A-Z, and characters with diacritical marks are not converted. If the string contains MIXED or DBCS characters, full-width Latin lowercase characters a-z are converted to full-width uppercase characters A-Z.
For optimal performance, specify a blank string unless your data must be processed by using rules that are defined by a specific locale.
- UNI
- Case conversions use both the NORMAL and SPECIAL casing capabilities as described in Select the conversions. UNI cannot be used with EBCDIC data.
UNI_60
The conversion uses Unicode Standard 6.0.0 and the NORMAL casing capability, as described in Select the conversions. You must not specify UNI_60 when string-expression is EBCDIC data.
UNI_90
The conversion uses Unicode Standard 9.0.0 and the NORMAL casing capability, as described in Select the conversions. You must not specify UNI_90 when string-expression is EBCDIC data.
- UNI_SIMPLE
- Case conversions use the NORMAL casing capabilities as described in Select the conversions. UNI_SIMPLE cannot be used with EBCDIC data.
- locale name
- The locale defines the rules for conversion to uppercase or lowercase characters. For information about locales and their naming conventions for EBCDIC data, see Locale naming conventions. For information about locales for Unicode and ASCII data, see z/OS Unicode Services User’s Guide and Reference.
You can change the value of the register by executing the statement SET CURRENT LOCALE LC_CTYPE.
- Fr_BE
- Fr_FR@EURO
- En_US
- Ja_JP
- Example
- Save the value of current register CURRENT LOCALE LC_CTYPE in host variable HV1, which is defined as VARCHAR(50).
EXEC SQL VALUES(CURRENT LOCALE LC_CTYPE) INTO :HV1;