COBOL Manual for TNS/E Programs (H06.03+)

Data Division
HP COBOL Manual for TNS/E Programs520347-003
7-66
PICTURE Clause
°
Zero suppression
Suppression of leading zeros in numeric character positions is done with a Z
or asterisk (*) in the PICTURE character-string. These symbols are mutually
exclusive in a single PICTURE character-string. When you use the asterisk,
you cannot use BLANK WHEN ZERO in the same entry. Each suppression
symbol is counted in the item’s size. Spaces replace Z s; asterisks remain
asterisks.
You specify zero suppression and replacement by using a string of one or
more Z s or asterisks to represent leading numeric character positions that are
to be replaced when any of those positions in the data are zero. Any of the
simple insertion characters embedded in the string of symbols or to the
immediate right of this string are part of the string.
0 $$$$$ (all spaces)
0 $$$99 $00
1234 +++99 +1234
-23 +++99 -23
4 +++99 +04
123 ------9 123
-123 ------9 -123
1.23 $$$9.99 $1.23
-1.23 $$$9.99 $1.23
0.03 $$$9.99 $0.03
-0.03 $$$9.99 $0.03
1.23 $$$$.$$ $1.23
-1.23 $$$$.$$ $1.23
0.03 $$$$.$$ $.03
-0.03 $$$$.$$ $.03
1.23 ---9.99 1.23
-1.23 ---9.99 -1.23
0.03 ---9.99 0.03
-0.03 ---9.99 -0.03
1.23 ----.-- 1.23
-1.23 ----.-- -1.23
0.03 ----.-- .03
-0.03 ----.-- -.03
Source Item PICTURE Edited Result (page 2 of 2)