COBOL Manual for TNS and TNS/R Programs
Data Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
7-67
PICTURE Clause
Examples of floating insertion editing:
°
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.
Source Item PICTURE Edited Result
123 $$999 $123
1234 $$$$$ $1234
2 $$999 $002
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