REPORTALIGN - Basic Teradata Query

Basic Teradata Query Reference

Product
Basic Teradata Query
Release Number
16.20
Published
October 2018
Language
English (United States)
Last Update
2020-02-20
dita:mapPath
kil1527114222313.ditamap
dita:ditavalPath
Audience_PDF_include.ditaval
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities

Purpose

This control enables users to specify the spacing used for Unicode report mode output.

Syntax



where the following is true:

COMPATIBLE
Displays Unicode report mode output such that each byte fills one physical space.

Note that for true UTF8 sessions on workstation platforms (where the I/O encoding and session character set encoding are both UTF8), if any output is truncated or wrapped, it is possible for a multibyte character to be split in two. For example, if truncation occurs in the middle of a Yen sign (0xC2A5), the output includes the 0xC2 byte, but not the 0xA5 byte. For all other Unicode sessions, BTEQ ensures a multi-byte character is not split in two.

COMPATIBLE is the default setting only for true UTF8 sessions on workstation platforms.

EQUALWIDTH
Displays Unicode report mode output such that each character fills only one physical space.
This is the default setting for the following sessions:
  • Whenever the I/O encoding or session character set encoding is UTF16 on workstation-attached systems
  • All UTF8 or UTF16 sessions on mainframe-attached systems.
COLUMNS
Displays Unicode report mode output such that each wide and full-width character fills two physical spaces, while all other characters fill one space. Wide and full-width characters are determined by the Unicode Character Database.

Usage Notes

For workstation-attached systems, REPORTALIGN affects only Unicode sessions writing to stdout, stderr, or export text files. However, it does not affect interactive Unicode sessions using the -m command line option.

For mainframe-attached systems, REPORTALIGN affects only Unicode sessions writing to export text files. SYSOUT is not affected since it is encoded in EBCDIC, even when the session character set is UTF8 or UTF16.

Depending on the character and its encoding, Unicode characters require 1-4 bytes.

Besides the three REPORTALIGN options, the application and font used for displaying BTEQ’S output are also major contributors in how characters are spaced in relation to one another. For example, some fonts are fixed-width, making spacing more uniform, while other fonts are variable-width.

The REPORTALIGN setting only affects the output for Field Mode, not Record Mode, Indicator Mode, or Multipart Indicator Mode.

Affected Behaviors

Different areas of BTEQ output are affected by the REPORTALIGN command, as shown in the following table.

  COMPATIBLE EQUALWIDTH COLUMNS
Spacing between multiple columns X X X
WIDTH truncation X X X
SEPARATOR string spacing X X X
NULL string spacing X X X
Page title spacing X X X
Wrapping of the user request* X X X
Wrapping of database messages* X X X
Spacing for suppressed fields X X X
Positioning of syntax error indicator*   X X
* The REPORTALIGN setting does not affect these areas on mainframe-attached systems since they are written to SYSOUT.

Example 1 – REPORTALIGN

The first column below contains 3-byte UTF-8 characters, while the second column contains 1-byte UTF-8 characters. Note that when using the COMPATIBLE option each byte in the first column is displayed as filling one physical space. This creates minimal spacing between columns.

.REPORTALIGN COMPATIBLE
SELECT * from align_tbl;

*** Query completed. 4 rows found. 2 columns returned.
*** Total elapsed time was 1 second.

Data                 WidthType
---------------      -----------------------------------------


Example 2 – REPORTALIGN EQUALWIDTH

For the EQUALWIDTH option, note that each character is displayed as filling one physical space. Therefore, each field in the first column contains 15 characters, including trailing spaces.

.REPORTALIGN EQUALWIDTH
SELECT * from align_tbl;

*** Query completed. 4 rows found. 2 columns returned.
*** Total elapsed time was 1 second.

Data                 WidthType
---------------      -----------------------------------------


Example 3 – REPORTALIGN COLUMNS

For the COLUMNS option, note that each wide and full-width character is displayed as filling two physical spaces. This is why the first fields for row 1 and 4 contain only 10 characters, including trailing spaces. All other width types display the same as the EQUALWIDTH option.

.REPORTALIGN COLUMNS
SELECT * from align_tbl;

*** Query completed. 4 rows found. 2 columns returned.
*** Total elasped time was 1 second.

Data                 WidthType
---------------      -----------------------------------------