1,975 pts.
 How to know whether some fields are changed in a display file
I have a display file with 25 fields. I want to know whether some value is changed when user hits enter. Since I have many fields in display file, taking each one and comparing with the file field is a difficult task. Any other suggestions?

Software/Hardware used:
As400, RPG
ASKED: February 7, 2013  5:07 AM
UPDATED: February 7, 2013  1:17 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question. Michael Tidmarsh   11,410 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

First, you would only have to make one comparison. All of the fields can be compared at once to see if anything changed. The values can be held in a data structure that can be compared to a saved version of the data structure.
 
You should also study the CHANGE (Change) keyword for display files. For 25 fields, you would possibly want to use the keyword at the record level.
 
The keyword does not tell you if input values are different from the output values. It only tells you if they have been changed. They might have been changed and then changed back to original values.
 
Tom

 108,260 pts.