Search code examples
ibm-midrangerpglerpg

RPGLE Leading zeros for non empty field only


I have subfile with first record using as fields for adding new file record. It's have to look like this.

___ ___ ___
FOO 001 002
BOO 003 004

Some of the fields must be numeric with leading zeros. A the same time for the first row it have to be not zeros but empty fields. Is it any solutions except casting all such fields to char or exclude the "add row" from subfile?


Solution

  • Define the field as character and populate it with the %editc function when the value is numeric.