The DECEDIT keyword on CTL-OPT (or H-spec) controls the decimal separator and thousands grouping character used by %EDITC and cycle output edit codes. Accepted values:
| Value | Decimal point | Thousands separator | Leading zero |
|---|---|---|---|
'.' |
. (period) |
, (comma) |
No |
',' |
, (comma) |
. (period) |
No |
'0.' |
. (period) |
, (comma) |
Yes |
'0,' |
, (comma) |
. (period) |
Yes |
When the value starts with 0, a leading zero is printed before the decimal separator for values whose integer part is zero (e.g. 0,75 instead of ,75).
The default (when DECEDIT is not specified) is '.'.
Free-format example:
CTL-OPT DECEDIT('0,');
DCL-S Amt PACKED(9:2) INZ(1234.56);
DCL-S Small PACKED(5:2) INZ(0.75);
Result = %EDITC(Amt : '1'); // → 1.234,56
Result = %EDITC(Small : '1'); // → 0,75
Fixed-format example:
H DECEDIT(',')
D Amt S 9P 2 INZ(1234.56)
C EVAL Result = %EDITC(Amt:'1')
C* Result = '1.234,56'
*JOBRUN is accepted and behaves as '.'.