0

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?

  • Why should the "add" row be a subfile row? Why isn't it simply part of the control record? – user2338816 Sep 15 '15 at 02:23
  • @user2338816 This way "add" row is scrollable. It's already working code. I just have to add some fields and don't change UI. – Alexandr Koshkin Sep 15 '15 at 06:43
  • It's not clear what you mean by "scrollable". The data would be just as "scrollable" if it was entered into control record fields. Input the control record and "add" the data to the subfile. Or do you mean that the "add" row scrolls off the display when you page down so that you always must scroll back to the top of the subfile in order to enter data? (Why would you want to make it harder for the user?) – user2338816 Sep 15 '15 at 14:49
  • @user2338816 Exactly, it scrolls of the display. I'm supporting old program and have no idea why anyone have such requirements. I don't have to change program logic as it's on production quite long. – Alexandr Koshkin Sep 16 '15 at 12:57
  • Personally, I would simplify the programming and make it easier for the user and handle the leading zeros problem by making the "add" row part of the control record. But if that's not an acceptable resolution in your environment, david's answer seems best. – user2338816 Sep 25 '15 at 11:26

2 Answers2

1

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

David G
  • 3,940
  • 1
  • 22
  • 30
0

Assuming these are output-only fields, you can keep the add row in the subfile with numeric fields, but put a DSPATR(ND) keyword on the fields that shouldn't show in the first row. Tie that DSPATR(ND) to an indicator that is set to *ON for the first row but *OFF for all subsequent rows.

Tracy Probst
  • 1,839
  • 12
  • 13