Purpose
This control enables users to specify the spacing used for Unicode report mode output.
Syntax
Command | Shorthand |
---|---|
REPORTALIGN | RA |
Option | Shorthand | Option | Shorthand | Option | Shorthand |
---|---|---|---|---|---|
COMPATIBLE | COM | EQUALWIDTH | EW | COLUMNS | COL |
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 UTF-8 sessions on workstation platforms.
- EQUALWIDTH
- Displays Unicode report mode output such that each character fills only one physical space.
- 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.
The REPORTALIGN command is valid in an SQL macro.
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
In the following example, the first column 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. Therefore, the first fields for rows 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 --------------- -----------------------------------------