SQL/MP Report Writer Guide

Customizing a Report
HP NonStop SQL/MP Report Writer Guide527213-001
4-63
Printing Double-Byte Characters
Using An Odd-Numbered Width Specification
When a double-byte character column is specified with either display descriptor A or
display descriptor C, and the display-width specification is an odd number for either
n
or w, double-byte character splitting can occur. To avoid this condition, always specify
an even-numbered display descriptor for a column that contains double-byte
characters.
For example, suppose that a column named LOCATION is defined as CHAR (20) with
the character set Kanji and that it contains the following data:
c1c2c3c4c5c6c7c8c9c0
c0c9c8c7c6c5c4c3c2c1c0c9c8c7c6
c1c3c5c7c9c0c8c6c4c2c0c1c3
c2c4c6c8c0c9c7c5c3c1c0c3
In Figure 4-27, the display descriptor, C40.15, is an odd number, which splits the eighth
double-byte character. To adjust for this condition, the display descriptor can be
specified as C40.14 or C40.16.
Using Incorrectly-Sized Display Descriptors
Data truncation occurs when the width of a display descriptor is too small for the value
in the field. If the field contains a double-byte character, truncation can split the
character. To avoid this condition, check that display descriptors specify areas large
enough for the field value.
For example, suppose a column named LOCATION is defined as CHAR (16) with the
character set Kanji and that it contains the following data:
c1c2c3c4c5c6c7c8c9c0
c0c9c8c7c6c5c4c3c2c1c0c9c8c7c6
c1c3c5c7c9c0c8c6c4c2c0c1c3
c2c4c6c8c0c9c7c5c3c1c0c3
Figure 4-27. Splitting Double-Byte Characters With an Odd-Numbered Display
Descriptor
S>DETAIL LOCATION AS C40.15;
S>L F 2;
LOCATION
c3c4c5c6c7c8c9@
@#@#@@@@###@#@#
@###@#@#@@
c0c9c8c7c6c5c4#
@@@#@####@@#@##
@#@#@#@#@#
S>
VST0427.vsd