In your program you have IN-FUND-NBR
defined more than once. The other definition(s) may be in a copybook, or something you have coded yourself without realising. The compiler discards the reference to the field.
The second diagnostic message about the reference-modification is because having discarded the reference to your data-name the compiler then encounters the opening parenthesis and your subscript. This message will disappear when you correct the problem.
Either, ensure that the data-names are unique. Or, in the nutty situation that this is not possible, you have to use qualification
. You do this by using IN or OF and referencing a higher level data-name.
From what you have shown:
DISPLAY "Fund Number: " IN-FUND-NBR OF SALES-RECORD (MF-SALE-SUB)
should work.
Although you can use qualification
to get around the problem, many are like me and find it a complete waste of time and patience, and others, especially beginners, find it a source of confusion. Try your best to always have unique data-names.