SQL/MX Report Writer Guide
Customizing a Report
HP NonStop SQL/MX Report Writer Guide—527194-002
4-38
Suppressing Leading or Trailing Zeros
•
In the first decoration, condition M specifies that this decoration applies if the
value is negative. location A1 specifies print position 1 for printing
charstring CR.
•
In the second decoration, condition MP specifies that this decoration applies if
the value is negative or positive. location and char-string are the same as
those shown in Figure 4-16.
•
In the third decoration, condition Z specifies that this decoration applies if the
value is zero. location A1 specifies print position 1 for printing char-string,
which is all blanks.
For character print items, you can specify only condition P.
This list shows the result of applying the preceding AS clause to different values:
You can use the BZ modifier instead of the third decoration to specify that you want the
field left blank if the value is zero:
AS '[MA1''CR'',MPF''$'' BZ ] F13.2'
You can insert the European decimal character in monetary values by changing the
default decimal character. For more information, see Redefining Special Characters on
page 4-48.
Suppressing Leading or Trailing Zeros
Leading zeros are suppressed automatically when you specify the F w. d[. m]
display descriptor and omit m. For example, F10.2 suppresses leading zeros, but
F10.2.5 prints leading zeros if the number of significant digits to the left of the decimal
point is less than 5:
The I w[. m] display descriptor also suppresses leading zeros if you omit m. For
example, I8 does not print leading zeros but I8.6 does if the integer consists of fewer
than 6 digits:
Value Result
-100 CR $ 100.00
4500 $ 4500
0
Descriptor Result
F10.2 355.67
F10.2.5 00.355.67
Descriptor Result
18 355
18.6 000355