Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

Zero suppression

The picture characters Z and asterisk (*) specify conditional digit positions in the character value and can cause leading zeros to be replaced by asterisks or blanks. Leading zeros are those that occur in the leftmost digit positions of fixed-point numbers or in the leftmost digit positions of the two parts of floating-point numbers, that are to the left of the assumed position of a decimal point, and that are not preceded by any of the digits 1 through 9. The leftmost nonzero digit in a number and all digits, zeros or not, to the right of it represent significant digits.

Z
Specifies a conditional digit position and causes a leading zero in the associated data position to be replaced by a blank. Otherwise, the digit in the position is unchanged. The picture character Z cannot appear in the same field as the picture character * or a drifting character, nor can it appear to the right of any of the picture characters in a field.
*
Specifies a conditional digit position. It is used the way the picture character Z is used, except that leading zeros are replaced by asterisks. The picture character asterisk cannot appear in the same field as the picture character Z or a drifting character, nor can it appear to the right of any of the picture characters in a field.

Table 37 shows examples of zero suppression characters.

Table 37. Examples of zero suppression characters
 
Source Attributes
Source Data
(in constant form)
 
Picture Specification
 
Character Value
FIXED(5)
FIXED(5)
FIXED(5)
12345
00100
00100
ZZZ99
ZZZ99
ZZZZZ
12345
bb100
bb100
FIXED(5)
FIXED(5,2)
FIXED(5,2)
00000
123.45
001.23
ZZZZZ
ZZZ99
ZZZV99
bbbbb
bb123
bb123
FIXED(5)
FIXED(5,2)
FIXED(5,2)
12345
000.08
000.00
ZZZV99
ZZZVZZ
ZZZVZZ
undefined
bbb08
bbbbb
FIXED(5)
FIXED(5)
FIXED(5,2)
00100
00000
000.01
*****
*****
***V**
**100
*****
***01
FIXED(5,2)
FIXED(5,2)
95
12350
$**9.99
$**9.99
$**0.95
$123.50
Note:
When the character value is undefined, the SIZE condition is raised.

If one of the picture characters Z or asterisk appears to the right of the picture character V, all fractional digit positions in the specification, as well as all integer digit positions, must use the Z or asterisk picture character, respectively. When all digit positions to the right of the picture character V contain zero suppression picture characters, fractional zeros of the value are suppressed only if all positions in the fractional part contain zeros and all integer positions have been suppressed. The character value of the data item will then consist of blanks or asterisks. No digits in the fractional part are replaced by blanks or asterisks if the fractional part contains any significant digit.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)