BTEQ's Unicode Support

Tools
Tools covers the tools and utilities you use to work with Teradata and its supporting ecosystem. You'll find information on everything from the Teradata Eclipse plug-in to load/extract tools.
Teradata Employee

BTEQ's Unicode Support

Introduction

This article describes the Unicode support provided by both Workstation BTEQ and Mainframe BTEQ.  It includes:

  • An explanation of encoding controls
  • How to invoke BTEQ to use Unicode sessions
  • Platform-specific limitations
  • How to handle key Unicode file attributes
  • How to view and align Unicode output

This article is intended for users who are familiar with Unicode and have used BTEQ in the past.  For more information on Unicode, please see the Unicode Consortium website (www.unicode.org).  For more information on BTEQ, please read the Basic Teradata Query Reference Manual (Publication B035-2414).

 

Terminology

Before we start, let’s define some terms used within this article…

Unicode_Table1a.JPG

 

Non-BMP Support

Both BTEQ and the Teradata Database support the UTF-8 and UTF-16 encoding forms of Unicode.  Starting in 16.00.00.00, BTEQ supports the full Unicode repertoire, including non-BMP characters.  However, the 16.00.00.00 Teradata Database supports only BMP characters unless the Unicode Pass Through (UPT) feature is turned on.  This can be accomplished by submitting the following DDL statement, after logging on to the Teradata Database: 

   SET SESSION CHARACTER SET UNICODE PASS THROUGH ON;

If the UPT feature is not turned on and a supplementary character is sent to the database, an error will be returned, similar to the following: 

   *** Failure 5356 One of the characters or code point does not

       exist within the specified repertoire.

 

I/O Encoding vs. Session Character Set Encoding

BTEQ provides two encoding controls for supporting Unicode.  The first control (I/O Encoding), handles the user interface for BTEQ.  On input, that includes stdin and RUN files.  On output, it includes stdout, stderr, and MESSAGEOUT files.

 

The second control (Session Character Set Encoding), handles the communication to/from the Teradata Database and the encoding of data files, which include import files, export files, and source files for SQL (internal) stored procedures.  Other external source files (for user-defined functions, user-defined methods, and external stored procedures) are an exception and must always be in the native encoding (ASCII for workstation clients or EBCDIC for mainframe clients).

 

Having two encoding values is necessary for Mainframe BTEQ, but also allows you to customize your Workstation BTEQ execution environment. 

 

The diagram below shows how the two encoding controls affect BTEQ.

 

Unicode_Diagram2.JPG 

 

Determining BTEQ’s Encoding Values

To see exactly what I/O encoding and session character set encoding BTEQ is using, execute the SHOW CONTROLS CHARSET command.  It will display the I/O encoding value along with the session charset value.  Below is an example of a Windows BTEQ session where the I/O encoding and session character set encoding are the same.  The first two values reflect the session character set encoding, and the third value reflects the I/O encoding.

 

Unicode_Win32_Encodings.JPG

Here is an example mainframe BTEQ session where the I/O encoding is always EBCDIC when the session character set is UTF8 or UTF16:

 

Unicode_MVS_Encodings.JPG

 

Byte Order Marks

All Unicode input and output files may optionally contain a Unicode Byte Order Mark (BOM), with the exclusion of stdout/stderr.  The encoding of a Unicode input file (including its BOM) must match the I/O encoding, and the encoding of a Unicode data file (including its BOM) must match the session character set encoding.  Similarly, the endianness of a UTF-16 file (and its BOM) must match the machine architecture for which BTEQ is running on.  UTF-8 files are not affected by endianness.

 

Workstation BTEQ

Workstation BTEQ can read Unicode input, write Unicode output, and send/receive Unicode data to/from the Teradata Database.  Initiating a Unicode session with Workstation BTEQ is accomplished with command line options.

 

Command Line Options

By default, when Workstation BTEQ is started, it creates an ASCII session.  But an ASCII session cannot handle Unicode interaction.  In order to create a Unicode session, Workstation BTEQ should be executed with the -c command line option, and optionally with the -e and -m options.  These three command line options are described below.

 

The SESSION CHARSET command should not be used to switch to a UTF8 or UTF16 character set for Workstation BTEQ.  Doing so would invalidate BTEQ’s output by having it comprised of multiple encodings.

 

-c option

This option defines the session character set encoding and takes an argument which can be any supported character set value.  See the International Character Set Support manual (Publication B035-1125) for a list of supported values.  Using the -c option would be analogous to submitting the SESSION CHARSET command at BTEQ startup time.  An alternative to using the -c option is to define the session character set using the "charset_id" entry in the clispb.dat file (see the Teradata Call-Level Interface Version 2 Reference for Workstation-Attached Systems – Publication B035-2418).  If both the -c option and clispb.dat file are used for defining the session character set value, the -c option has precedence.

 

To start Workstation BTEQ with a Unicode session, specify ‘UTF8’ or ‘UTF16’ for the -c option.  For example, the following start Unicode sessions where the I/O encoding and session charset encoding are the same: 

   bteq -c utf8                # interactive mode

   bteq -c utf16 < script      # batch mode

Note: The I/O encoding will default to the session character set value if either the -e or –m options are not used (see below).

 

-e option

This option defines the I/O encoding for a Unicode session and takes a character set argument.  The only possible values are:

  • UTF8
  • UTF16

This option is only valid when you define the session character set as ‘UTF8’ or ‘UTF16’ with the -c option or within the clispb.dat file.  It allows user input/output to be in one Unicode encoding while allowing Workstation BTEQ to communication with the Teradata Database in another Unicode encoding.  For example:

         bteq -e utf8 -c utf16 < input.txt > output.txt 2>&1

In this case, input.txt and output.txt will be encoded in UTF-8.  However, the communication to/from the Teradata Database is in UTF-16.

 

Use this option for executing Workstation BTEQ in batch mode when you want the I/O encoding and session character set encoding to be different Unicode transformation formats.  For interactive mode, it is best to use BTEQWIN or the -m option (see below).

 

-m option

The -m option indicates that I/O for an interactive Unicode session will be encoded in multi-byte characters based on the system locale, which is completely configurable by the user (as will be discussed in the next sections).  This allows for the proper interactive reading and writing of non-Latin characters.  This option does not take any arguments and similar to the -e option, it is only valid when you define the session character set as ‘UTF8’ or ‘UTF16’ with the -c option or within the clispb.dat file.

 

When the I/O encoding is controlled by the -m option, RUN files must be encoded in multi-byte characters based on the locale, not UTF-8 or UTF-16. Likewise, Workstation BTEQ will write multi-byte characters to MESSAGEOUT files. And be aware that Workstation BTEQ will be limited to the characters that the current locale can handle. For example, Thai characters may not be read or displayed properly when a Japanese locale is used (see the screen example below). Characters outside the system's locale will most likely be displayed as a question mark ('?').

 

Unicode_Thai2.JPG

If an interactive Unicode session is started without the -m option, then I/O may not work as expected, because the default “C” locale is used. The “C” locale only consists of single- byte ASCII characters. Workstation BTEQ will read in stdin as an ASCII stream, severely limiting the input character range. Stdout/stderr will be written to as a UTF-8 or UTF-16 stream, but characters may be displayed on the screen incorrectly due to the default locale setting.

 

Defining the system locale on Windows for the –m option

  • Go to CONTROL PANEL.
  • Select the REGIONAL AND LANGUAGES icon.
  • Select the ADMINISTRATIVE tab.
  • Change the “System locale” to an appropriate language. You may have to install appropriate language support first if the language you require is not available. Here is what the screen looks like on Windows 7:

Unicode_Windows_locale.JPG

 

Defining the locale on Unix for the –m option

  • Make sure the machine has appropriate language support software installed. Multiple packages may be required.
  • Use "locale -a" to view the available locales.
  • Set the LC_CTYPE environment variable to an available locale. Example below:

Unicode_Unix_locale.JPG

 

Command Line Option Considerations

  • When a Unicode input file is redirected through stdin for batch mode, it is highly recommended that the I/O encoding be initially set with the -c option, -e option, or clispb.dat file.  Otherwise, Workstation BTEQ will try to interpret whether the input file is Unicode and will automatically set the session character set value to what it thinks is correct, as follows.   Here is how Workstation BTEQ handles “bteq < unicode_file”:
  1. BTEQ will check the input file for a leading UTF-16 or UTF-8 BOM and will automatically change the session character set to the appropriate Unicode encoding if a valid BOM is found. 
  2. If a BOM-less UTF-16 input file is used, BTEQ will validate if the first two bytes actually make up a valid UTF-16 character before automatically changing the session character set to ‘UTF16’.  Note that BTEQ will not automatically change the session character set for a BOM-less UTF-8 input file, and will assume ASCII instead. 
  3. If none of the above applies, BTEQ will assume the input file is not Unicode and will default the session character set to ASCII.
  • Once a UTF16 session has been started, Workstation BTEQ does not allow the session character set encoding to be changed with the SESSION CHARSET command.  Since the UTF-16 encoding is unlike any other, this prevents output from getting corrupted with a mixture of incompatible encodings.
  • When any of these options and BTEQ commands are specified together on the command line, the command line options must be listed first. 

 

Windows BTEQ Shortcut Customization

If you prefer to start Windows BTEQ from the Start...Programs...Teradata Client shortcut, there is a way to customize it so that you always start BTEQ within a Unicode session.  Simply right click on the Start...Programs...Teradata Client...Teradata BTEQ icon, and then left click on Properties.  In the Target box, append the command line options of your choice (outside of any quotes).  Click the Apply button, then OK.

 

BTEQWIN

If you require an interactive Unicode session on Windows, consider using BTEQWIN, which is a true Unicode Windows application, instead of the BTEQ command line interface.  BTEQWIN can be started by clicking on the Programs...Teradata Client...Teradata BTEQwin icon, or by executing bteqwin.exe from the command line.

 

When you start BTEQWIN, it first displays the "Select Session Charset Dialog" window, which gives you a choice of four session character set values, including “UTF8” and “UTF16”.  Once a choice has been made, a BTEQ session is opened up within a BTEQWIN window.  It executes as if you started BTEQ with the -c option.  Both the I/O encoding and the session character set encoding are based on your choice from the "Select Session Charset Dialog" window.  Since BTEQWIN is a Unicode application, your I/O is not limited to the current system locale setting.  BTEQWIN can read and write all Unicode characters within the BMP.

 

BTEQWIN supports a variety of fonts, many of which do not display all Unicode characters properly.  Adverse effects may occur if you choose a font which is not Unicode capable.  It is best to try out different fonts to see which one performs the best for your needs.

 

BTEQWIN is not available on non-Windows systems.

 

Batch Invocation Examples

bteq -c utf16 < input.txt > output.txt 2>&1

This is an example of a UTF-16 batch session.  Both the I/O encoding and the session character encoding are UTF-16, which means all communication and all files are UTF-16 encoded.  Workstation BTEQ is driven by the UTF-16 input script, input.txt, which can optionally contain a UTF-16 BOM.  Stdout and stderr are stored in output.txt, a UTF-16 file which does not contain a BOM.  Both input.txt and output.txt can be viewed using an appropriate Unicode editor (like Windows Notepad).

 

bteq -e utf8 -c utf16 < input.txt > output.txt 2>&1

This is an example of a batch session, where the I/O encoding is UTF-8, but the session character set is UTF-16.  This means that input.txt and output.txt are both UTF-8 encoded, while the communication and data sent to/from the Teradata Database is in UTF-16.

 

bteq < input.txt > output.txt 2>&1

This is another batch session, but let's assume that input.txt is a UTF-8 file containing a BOM. In this case, Workstation BTEQ automatically sets the I/O encoding and the session character set encoding to UTF-8, based on the BOM encountered in input.txt.  This means that output.txt and the data sent to/from the Teradata Database will also be UTF-8 encoded.

 

Interactive Invocation Examples

bteq -c utf16 -m

This is an example of how to start an interactive Unicode session.  BTEQ assumes that the system locale is already set and that all I/O will be encoded in multi-byte characters based on that locale, including RUN files.  UTF-16 encoded RUN files are not supported.  The communication with the Teradata Database and all data files will be UTF-16 encoded.  The –m option allows non-Latin characters to be displayed correctly, as shown below.

 

Unicode_Interactive_M.JPG

 

bteq –c utf8 –m

This is similar to the previous example, except that the communication with the Teradata Database and all data files will be UTF-8 encoded.  

 

Unicode_Interactive_Mutf8.JPG

 

bteq -c utf16

This is an example of how NOT to start an interactive Unicode session.  Since the -m option is not used, the operating system controls the user’s input/output.  UTF-16 encoded RUN files are supported, but all interactive input is limited to single-byte ASCII characters.  And output is written with UTF-16 encoded characters, which may be displayed with extra spacing or garbage, depending upon the operating system being used, as seen below. 

 

Unicode_Interactive_UTF16.JPG

 

Using Fonts to View Output

When output is saved from a Unicode batch session, use an appropriate Unicode editor to view the output file.  Be aware that the font controls what type of glyphs are displayed within your editor.  Most editors provide an array of fonts, however, only some display non-Latin glyphs correctly.  Experiment to see which fonts serve your purpose the best.  Start off by trying some of these fonts, which are available through many Microsoft Windows applications:

  •  Arial
  • Courier New
  • Lucinda Console
  • Microsoft Sans Serif
  • Tahoma

Here is an example of a UTF-16 file displayed using the FixedSys font within Windows Notepad.  Notice several of the non-Latin glyphs cannot be displayed. 

 

Unicode_Font1.JPG

Here is the same file displayed using the Courier New font.  The non- Latin glyphs are displayed correctly.

 

Unicode_Font2.JPG

 

Valid Code Points for BTEQ Commands

Although Workstation BTEQ supports the complete range of Unicode characters, when executing a Unicode script, BTEQ commands must consist of Latin characters within the range U+000020 through U+00007E.  Although Unicode provides alternatives for some of these basic characters (such as U+00FF10 – Fullwidth Digit Zero or U+00FF21 – Fullwidth Latin Capital Letter A), these are not valid code points for BTEQ command name and option keywords.

 

Mainframe BTEQ

Mainframe BTEQ has limited Unicode support compared to Workstation BTEQ.  Mainframe BTEQ can send/receive Unicode data to/from the Teradata Database but cannot read Unicode characters from SYSIN or write Unicode characters to SYSOUT.

 

Here are the main points to know:

  • Only the session character set can be defined as UTF8 or UTF16, which means only import, export, and internal store procedure data sets can be Unicode encoded, along with the communication to/from the Teradata Database.
  • I/O encoding is always EBCDIC when the session character set is UTF8 or UTF16.
  • Mainframe BTEQ does not support command line options.  It is always started the same way in the JCL.  For example:

       //BTEQ EXEC PGM=BTQMAIN

  • Mainframe BTEQ is always started in the default EBCDIC session character set.  After startup, submit the SESSION CHARSET command with a “UTF8” or “UTF16” argument to establish the Unicode session.  The SESSION CHARSET command can be used to switch back and forth to any supported character set, as long as an export is not active.
  • Use the SHOW CONTROLS CHARSET command to see the current encoding values enforced by Mainframe BTEQ.
  • When defining an export REPORT data set for use within a Unicode session, make sure that the LRECL argument is based on the maximum number of bytes that can be written.  Remember that the maximum number of bytes for a single UTF-8 or UTF-16 character is 4 bytes.  So, if the maximum length of a record is 80 characters, then the LRECL value must be set to at least 320 (for RECFM=FB) or 324 (for RECFM=VB). 
  • Non-Latin Unicode characters cannot be displayed to SYSOUT since they are not part of the EBCDIC repertoire.  Mainframe BTEQ will display a warning message whenever it cannot translate a Unicode character to EBCDIC.  Therefore, make sure that all non- Latin Unicode data is exported instead of written to SYSOUT.
  • Unicode export data sets can be viewed using the ISPF editor in BROWSE mode by entering a command of “HEX ON”, “DISPLAY UTF8”, or “DISPLAY UTF16”.  Or you can FTP the file to a different machine and use an alternative editor.
  • When describing VARCHAR columns for an import USING clause, remember that their sizes are based on bytes, not characters.
  • Example Mainframe BTEQ script for a UTF16 session:
//DL123450 JOB (00000001),'DL123450',NOTIFY=DL12345,
// CLASS=B,MSGCLASS=X,MSGLEVEL=(1,1)
//*
//JOBLIB DD DSN=STV.TJ20APP.APP.L,DISP=(SHR,PASS)
//*
//STEPCRT EXEC PGM=IEFBR14
//DELETE DD DSN=DL12345.RUNBTEQ.OUTPUT,
// DISP=(MOD,DELETE,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(50,50)),
// DCB=(RECFM=VB,BLKSIZE=10000,LRECL=100,DSORG=PS)
//*
//CREATE DD DSN=DL12345.RUNBTEQ.OUTPUT,
// DISP=(NEW,CATLG),
// UNIT=SYSDA,
// SPACE=(TRK,(50,50)),
// DCB=(RECFM=VB,BLKSIZE=10000,LRECL=100,DSORG=PS)
//*
//DELETE DD DSN=DL12345.RUNBTEQ.EXPORT1,
// DISP=(MOD,DELETE,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(50,50)),
// DCB=(RECFM=VB,BLKSIZE=10000,LRECL=400,DSORG=PS) //*
//CREATE DD DSN=DL12345.RUNBTEQ.EXPORT1,
// DISP=(NEW,CATLG),
// UNIT=SYSDA,
// SPACE=(TRK,(50,50)),
// DCB=(RECFM=VB,BLKSIZE=10000,LRECL=400,DSORG=PS)
//*
//BTEQ EXEC PGM=BTQMAIN
//SYSPRINT DD DSN=DL12345.RUNBTEQ.OUTPUT,DISP=MOD
//EXPFILE DD DSN=DL12345.RUNBTEQ.EXPORT1,DISP=MOD
//SYSABEND DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSTERM DD SYSOUT=*
//SYSIN DD DATA,DLM=##
/***************************************************************/
/* Description : Sample script encoded as EBCDIC, that will */
/* start a UTF16 database session. */
/***************************************************************/
.WIDTH 72
.SHOW CONTROLS CHARSET
.SET SESSION CHARSET 'UTF16'
.SHOW CONTROLS CHARSET
.LOGON TDXX/doug,xxxx

/***************************************************************/
/* Write Yen sign to stdout in FIELD mode, resulting in a */
/* translation failure because the Yen sign is not part of the */
/* EBCDIC repertoire. */
/***************************************************************/
SELECT U&'#+00FFE5' UESCAPE '#';

/***************************************************************/
/* Write Yen sign to stdout in RECORD mode. */
/***************************************************************/
.FORMAT OFF
.RECORDMODE ON
SELECT U&'#+00FFE5' UESCAPE '#';

/***************************************************************/
/* Export 3 Yen signs to a text data set with BOM. */
/***************************************************************/
.EXPORT REPORT DDNAME=EXPFILE
.TITLEDASHES OFF
SELECT U&'#+00FFE5#+00FFE5#+00FFE5' UESCAPE '#' (TITLE '');
.EXPORT RESET

/***************************************************************/
/* Import that data by displaying it in hex format to SYSOUT. */
/***************************************************************/
.IMPORT VARTEXT ',' DDNAME=EXPFILE
.RECORDMODE ON
.REPEAT *
USING (col1 VARCHAR(6))
SELECT :col1;
.IMPORT RESET

.LOGOFF
.QUIT
##

  

  • Output generated from the above sample script:
DEFAULT HSISPB 11/21/16 01 BTEQ 16.00.00.00 Wed Mar 29 14:10:56 2017 PID: 67109627

+---------+---------+---------+---------+---------+---------+---------+- /******************************************************************/
/* Description : Sample script encoded as EBCDIC, that will */
/* start a UTF16 database session. */
/******************************************************************/
.WIDTH 72
+---------+---------+---------+---------+---------+---------+---------+-
.SHOW CONTROLS CHARSET

[SET] SESSION CHARSET = EBCDIC
import/export encoding = EBCDIC
stdin/stdout encoding = EBCDIC

+---------+---------+---------+---------+---------+---------+---------+-
.SET SESSION CHARSET 'UTF16'
+---------+---------+---------+---------+---------+---------+---------+-
.SHOW CONTROLS CHARSET
[SET] SESSION CHARSET = UTF16
import/export encoding = UTF16
stdin/stdout encoding = EBCDIC

+---------+---------+---------+---------+---------+---------+---------+- .LOGON TDXX/doug,

*** Logon successfully completed.
*** Teradata Database Release is 16.00.00.00
*** Teradata Database Version is 16.00.00.00
*** Transaction semantics are BTET.
*** Session Character Set Name is 'UTF16'.

*** Total elapsed time was 0.10 seconds.

+---------+---------+---------+---------+---------+---------+---------+-
/******************************************************************/
/* Write Yen sign to stdout in FIELD mode, resulting in a */
/* translation failure because the Yen sign is not part of the */
/* EBCDIC repertoire. */
/******************************************************************/
SELECT U&'# +00FFE5' UESCAPE '#';

*** Query completed. One row found. One column returned.
*** Total elapsed time was 0.00 seconds.

*** Warning: UTF-16BE to TD_EBCDIC translation failed.
TDICU UErrorCode: 10 - U_INVALID_CHAR_FOUND
Remaining statement output will be discarded.

+---------+---------+---------+---------+---------+---------+---------+-
/******************************************************************/
/* Write Yen sign to stdout in RECORD mode. */
/******************************************************************/
.FORMAT OFF
+---------+---------+---------+---------+---------+---------+---------+- .RECORDMODE ON
+---------+---------+---------+---------+---------+---------+---------+-
SELECT U&'# +00FFE5' UESCAPE '#';

*** Success, Stmt# 1, ActivityCount = 1
*** Query completed. One row found. One column returned.
*** Total elapsed time was 0.00 seconds.

*** Record#1. Dump Of Data:
0000 0002 FFE5 *...V*

+---------+---------+---------+---------+---------+---------+---------+-
/******************************************************************/
/* Export 3 Yen signs to a text data set with BOM. */
/******************************************************************/
.EXPORT REPORT DDNAME=EXPFILE
*** To reset export, type .EXPORT RESET
+---------+---------+---------+---------+---------+---------+---------+-
.TITLEDASHES OFF
+---------+---------+---------+---------+---------+---------+---------+-
SELECT U&'#+00FFE5#+00FFE5#+00FFE5' UESCAPE '#' (TITLE '');

*** Query completed. One row found. One column returned.
*** Total elapsed time was 0.00 seconds.

+---------+---------+---------+---------+---------+---------+---------+-
.EXPORT RESET
*** Output returned to console.
+---------+---------+---------+---------+---------+---------+---------+-
/******************************************************************/
/* Import that data by displaying it in hex format to SYSOUT. */
/******************************************************************/
.IMPORT VARTEXT ',' DDNAME=EXPFILE
+---------+---------+---------+---------+---------+---------+---------+-
.RECORDMODE ON
+---------+---------+---------+---------+---------+---------+---------+-
.REPEAT *
+---------+---------+---------+---------+---------+---------+---------+-
USING (col1 VARCHAR(6))
SELECT :col1;
*** Starting record 1 at 14:10:56 on Wed Mar 29, 2017
*** Success, Stmt# 1, ActivityCount = 1
*** Query completed. One row found. One column returned.
*** Total elapsed time was 0.00 seconds.

*** Record#1. Dump Of Data:
0000 0006 FFE5 FFE5 FFE5 *...V.V.V* *** Warning: Out of data.
*** Finished at record 1 at 14:10:56 on Wed Mar 29, 2017
*** Total number of statements: 1, Accepted : 1, Rejected : 0

*** Total elapsed time was 0.01 seconds.

+---------+---------+---------+---------+---------+---------+---------+-
.IMPORT RESET
*** Importing deactivated.
+---------+---------+---------+---------+---------+---------+---------+-

.LOGOFF
*** You are now logged off from the DBC.
+---------+---------+---------+---------+---------+---------+---------+-
.QUIT

*** Exiting BTEQ...

 

The REPORTALIGN Command

BTEQ’s REPORTALIGN command is specifically designed for Unicode sessions to help with the alignment of report mode output.  The wrapping, truncation, and spacing of text all affect the way that report mode output is aligned.  BTEQ allows the alignment to be based either on bytes, characters, or print widths.  The three options for REPORTALIGN command are:

Unicode_Table2a.JPG

 

Here are the default REPORTALIGN settings for BTEQ’s various Unicode sessions and the BTEQ releases which support REPORTALIGN:

Unicode_Table3a.JPG

 

The following is sample output showing the effect of the 3 REPORTALIGN options within a UTF8 session.  The Yen sign is a full-width character, made up of 3 bytes.  Notice that the results are truncated to the WIDTH value differently based on the REPORTALIGN setting.

 

Unicode_Reportalign.JPG

The REPORTALIGN command does not affect output generated from non-Unicode database sessions. 

 

For more information and examples, see the REPORTALIGN description in Chapter 5 of the BTEQ Reference Manual.

 

Conclusion

BTEQ provides flexibility, allowing users various ways in which to handle Unicode data.  It is up to you to determine which way is the most productive for your environment.