ZERO Suppression and Replacement Editing
ZERO Suppression and Replacement Editing
- Zero Suppression involves omitting leading zeros from a number, and replacement editing involves replacing leading zeros with another character, typically a space or an asterisk (*).
- These techniques ensure that leading zeros are removed from the number and displayed in a more reader-friendly manner.
- These techniques are applicable only to numeric-edited items.
There are two varieties of suppression and replacement editing -
- Suppression of leading zeros and replacing with spaces.
- Suppression of leading zeros and replacing with asterisks.
ZERO suppression and replacement editing symbols are -
- Z - Suppresses leading zeros. The leading zeros are replaced by spaces and displays the digits that is valid number.
- * - Replaces leading zeros with asterisks.
- Z and * - A combination of both.
Note! The length of the edited PIC clause may or may not be the same as the original PIC clause.
Examples -
Editing PICTURE | Input | Output |
---|---|---|
9(3),9(2) | 123.45 | 001,23 |
ZZ,999 | 12345 | 12,345 |
ZZ,999 | 1234 | B1,234 |
ZZ,ZZ9 | 123 | BB123 |
ZZ,ZZ9 | 12 | BBB12 |
**,**9 | 7891 | *7,891 |
**,**9 | 789 | ***789 |
**,*** | ZEROES | ****** |
$**,**9 | 12.34 | $****12 |
**,**9.99 | 123.45 | ***123.45 |