REPORTALIGN - Basic Teradata Query

Basic Teradata Query Reference

Product
Basic Teradata Query
Release Number
15.00
Language
English (United States)
Last Update
2018-09-25
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities

REPORTALIGN

Purpose  

Determines the spacing used for UTF-8 report mode output.

Syntax  

where

 

Syntax Element

Specification

COMPATIBLE

Displays UTF-8 report mode output such that each byte fills one physical space.

Note that if any output is truncated, it is possible for a multi-byte 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.

If no option is used, this is the default value.

EQUALWIDTH

Displays UTF-8 report mode output such that each character fills only one physical space.

COLUMNS

Displays UTF-8 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  

The REPORTALIGN command affects only true UTF-8 sessions for workstation BTEQ. These are sessions where the I/O encoding and the session character set encoding are both UTF8. The REPORTALIGN command does not affect sessions where the I/O encoding is UTF8 and the session character set encoding is UTF16, or vice versa. Similarly, the REPORTALIGN command does not affect interactive sessions using the -m command line option.

REPORTALIGN is not supported for mainframe BTEQ.

Depending on the character, UTF-8 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

Example 1

The following example is displayed in “Courier New” font. 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

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

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
--------------- -----------------------------------------