SQL/MX Report Writer Guide

Customizing a Report
HP NonStop SQL/MX Report Writer Guide527194-002
4-39
Concatenating Text
Use the uppercase letter Z to suppress leading and trailing zeros in a mask:
You can use the BZ modifier to suppress all zeros when the value is zero; for example,
AS ’[BZ] M<ZZZZ>’. If you include a modifier, you must enclose the modifier and
display descriptor in single quotation marks.
For information about replacing suppressed leading zeros with a character, see Filler
Characters on page 4-40.
You can also suppress trailing zeros by truncating the value.
Concatenating Text
Use the CONCAT clause for formatting names of persons or places. You can
concatenate parts of names stored in separate columns of a table and insert
characters between the concatenated values.
In the EMPLOYEE table, FIRST_NAME and LAST_NAME are stored in separate
columns. You can define a print item of a detail line to concatenate the names in two
ways:
CONCAT (LAST_NAME STRIP, ', ', FIRST_NAME)
or
CONCAT (FIRST_NAME STRIP, SPACE 1, LAST_NAME)
The first clause produces BENEDETTI, JULIO, and the second clause produces JULIO
BENEDETTI. You can use a similar technique to combine city and state or to combine
addresses in one field.
If you specify STRIP, the report writer strips trailing blanks from the value before
concatenating it. The default width of the concatenated item is the sum of the original
column widths before the blanks are stripped plus the width of any inserted strings.
Mask Value Result
M<ZZZ,ZZ9.99> 2.453 2.45
9023.00 9023.00
M<9,999> 5432 5,432
300 0,300
00,000
M<ZZZZ> 300 300
M<$ZZZ9.99> 5432 $5432.00
300.153 $ 300.15
0 $ 0.00