Sign in

docs RPG Reference

DECEDIT(*JOBRUN | 'value')

DECEDIT(*JOBRUN | ‘value’)

The DECEDIT keyword specifies the characters used as the decimal point and digit separator (thousands separator) for edited decimal numbers and whether or not leading zeros are printed.

Note: Zeros to the right of a decimal point are always printed.

If keyword EXPROPTS(*USEDECEDIT) is specified, the DECEDIT keyword also specifies the decimal point and digit separator for the built-in functions such as %DEC that convert character to numeric. See Rules for converting character values to numeric values using built-in functions.

If DECEDIT is not specified, the default decimal point is a period (.) and the default digit separator is a comma (,).

If *JOBRUN is specified, the DECFMT value associated with the job at runtime is used. The possible job decimal formats are listed in the following table:

Table 1. DECEDIT with *JOBRUN

Job Decimal FormatDecimal PointDigit SeparatorPrint Leading ZerosEdited Decimal Number
blankperiod (.)comma (,)No.123
Icomma (,)period (.)No,123
Jcomma (,)period (.)Yes0,123

If a value is specified, then the edited decimal numbers are printed according to the following possible values:

Table 2. DECEDIT with ‘value'

'Value’Decimal PointDigit SeparatorPrint Leading ZerosEdited Decimal Number
’.‘period (.)comma (,)No.123
’,‘comma (,)period (.)No,123
’0.‘period (.)comma (,)Yes0.123
’0,‘comma (,)period (.)Yes0,123