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 are used to ensure that leading zeros in a number are displayed in a more reader-friendly manner.
These techniques applicable to only for numeric-edited items. There are two varieties of suppression and replacement editing -
- Suppression of leading zeros and replacement with spaces.
- Suppression of leading zeros and replacement with asterisks.
The syntax for special insertion editing involves the use of editing symbols -
- Z - Suppresses leading zeros. When the number is displayed or printed, the leading zeros are replaced by spaces.
- * - Replaces leading zeros with asterisks.
- Z and * - A combination of Z and *.
Note! The length of the edited PIC clause may or may not be same as source PIC clause.
Examples -
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 |