I quickest, most accurate, and most secure way of doing this it to Journal the PF.
You do not have to make any coding changes and it will also capture any other changes made from outside your program.
Another option is to create a trigger program that would compare the before and after images of the record. Then you could write the changes to a log, This might be better if you are only looking for selected field changes.
The last option is to modiffy your maintenance program to compare the fields from the file agains those entered by the user and write an audit record at that time.
<i>determine if ANY fields have changed</i>
Changes a field how? Through a DSPF that you wrote and displayed with a program you wrote? Through UPDDTA? Through STRSQL? Through something else?
If your programming is in control, you could compare what was returned as display input to your program against a copy of the display output from your program. If they’re different, then it was changed. If your programming is not in control, you can use a trigger program to compare ‘old record’ to ‘new record’. If those are different, then a change was made.
Are you scanning a file to see if changes were made in the past? Or is this a real-time process?
If it’s real-time, then the trigger is probably your best choice. If it’s after the fact, then proper journaling is probably the only choice you have. If proper journaling wasn’t done, then you might only be able to check against some backup of the file. If proper backups aren’t available, you probably can’t even determine <b>if</b> any changes were made.