CURRENT LOCALE LC_CTYPE

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.

Start of changeThe 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:End of change

Start of change
  • 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.
  • 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.
End of change

The initial value of CURRENT LOCALE LC_CTYPE is determined by the value of field LOCALE LC_CTYPE on installation panel DSNTIPF. The default for the initial value of that field is blank unless your installation has changed the value of that field. The initial value of CURRENT LOCALE LC_CTYPE in a user-defined function or stored procedure is inherited according to the rules in Table 1.

You can change the value of the register by executing the statement SET CURRENT LOCALE LC_CTYPE.

Start of changeSome examples of locales for EBCDIC data include:
Fr_BE
Fr_FR@EURO
En_US
Ja_JP
End of change
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;