userEditCodes

userEditCodes

The values for each code should match exactly what is configured on your IBM i system via WRKEDTD.

Description

Set this option to an object containing definitions for IBM i user-defined edit codes ("5" through "9"), as configured with the WRKEDTD command on your IBM i system.

These definitions are used both at conversion time (DDS to PUI JSON) and at run time, when RPG programs call %EDITC() with a user-defined code.

Properties

Each key is a single digit ("5" through "9"). The value is an object with the following properties:

Property

Description

Property

Description

integerMask

Integer portion mask string (commas indicate thousands separators).

decimalPoint

Decimal point character ("." or ",").

fractionMask

Fractional digits mask string.

fillCharacter

Fill/pad character (for example "*" for check protection).

currencySymbol

Currency symbol string (for example "$").

editZeroValues

Boolean. Whether to display zero values.

negativeStatus

Sign indicator for negative values ("-", "CR", "DB", and so on).

positiveStatus

Suffix appended to positive values (for example " " or "DR").

leftConstant

Constant string prepended to the formatted value.

rightConstant

Constant string appended to the formatted value.

Example

Two user-defined edit codes matching a WRKEDTD configuration:

userEditCodes: { // Edit code 8: currency, always show zeros, minus sign for negatives. "8": { integerMask: " , , , , 0 ", decimalPoint: ".", fractionMask: " ", fillCharacter: "", currencySymbol: "$", editZeroValues: true, negativeStatus: "-", positiveStatus: " ", leftConstant: "", rightConstant: "" }, // Edit code 5: suppress zeros, CR/DR suffixes instead of a sign. "5": { integerMask: " , , , , 0", decimalPoint: ".", fractionMask: " ", fillCharacter: "", currencySymbol: "", editZeroValues: false, negativeStatus: "CR", positiveStatus: "DR", leftConstant: "", rightConstant: "" } }

For information on how to modify this setting, see Configuration File.