16.20 - Establishing the Kanji Character Set - Basic Teradata Query

Basic Teradata Query Reference

Basic Teradata Query
October 2018
Programming Reference
To establish a character set, you can do any of the following:
  • Establish a character set that is in effect for a BTEQ job.
  • Override the default character set.
  • Switch between multibyte and English modes.

The character set is preserved for the duration of the session (until a QUIT), not just for the logon.

You can establish a character set in one of the following ways:
  • Specify the character set with the BTEQ SESSION CHARSET command.

    You do not need to issue the command when you log on to BTEQ. Issue the command before you run the operation that needs to be in a particular character set. This user-specified character set will override all other character sets previously specified or placed in default.

    For example:


    At logon, for example, if the logon string is normally in the form:

    BTEQ .LOGON  tdpid/user,password

    you could modify it to use KanjiEBCDIC as follows:

    .LOGON  tdpid/user,password
    The .SET string must precede the .LOGON string.
  • Specify a character set value in:
    • The HSHSPB parameter module for IBM mainframes
    • The clispb.dat file for UNIX platforms

      This takes second precedence.

  • If a character set has not been user-specified or specified in HSHSPB or clispb.dat, then the default is the value in the system table, DBC.Hosts.

If an application relies on the DBC.Hosts table for the default character set name, you must ensure that the initial logon from the mainframe-attached side is in KanjiEBCDIC; otherwise, the default character set cannot be known to the application before logon.