Fixed Insertion Editing
Fixed Insertion Editing
Fixed insertion editing is a method used to insert fixed characters into a numeric edited item. It allows characters such as minus (-), plus (+), credit (CR), Debit (DB), and dollar ($) to be placed in predefined positions within a numeric item. The editing functions help in providing a way to format data for display or printing.
Notes -
- Fixed insertion editing is applicable only for numeric items.
- These symbols are counted in the size of the item.
- The edited variable's length may differ from the same variable's length before editing.
Symbols -
For numeric edited variables, use the PICTURE (or PIC) clause with the following symbols -
- + : Plus sign used to highlight the sign of the value. If the value is negative, a minus is printed. If the value is positive, a plus is printed. It should be the first or last character in the PICTURE string.
- - : Minus sign to highlight negative values only. If the value is negative, a minus sign is printed. If the value is positive, a space is printed instead. It should be the first or last character in the PICTURE string.
- $ : Dollar sign insertion for currency representation. It should be the leftmost character.
- CR : Displays "CR" if the entire number is negative; otherwise, displays spaces. It should define as the rightmost two-character positions.
- DB : Displays "DB" if the entire number is negative; otherwise, displays spaces. It should define as the rightmost two-character positions.
Examples -
PICTURE | Input | Output |
---|---|---|
S9(5) | -247 | 0024P |
-9(5) | -247 | -00247 |
+9(5) | -247 | -00247 |
9(5)- | -247 | 00247- |
9(5)+ | -247 | 00247- |
-9(5) | +1047 | B01047 |
9(5)CR | +1047 | 01047BB |
9(5)CR | +1047 | 01147CR |
9(5)DB | -1147 | 01047BB |
9(5)DB | -1147 | 01147DB |
$9(5) | 1547 | $01547 |
$ZZZZZ | ZEROES | BBBBBB |
$ZZZZ9 | ZEROES | $BBBB9 |
Note! B represents space in the above table.