20 pts.
 How to handle deletion in RPG
I have a file(A) that needs to have records deleted from it based off information in another file(B). I think the logic should be... Read A Chain to B if criteria met delete record. Is there a better/cleaner way to do this? I do not have much experience with RPG.

Software/Hardware used:
ASKED: October 21, 2009  2:35 PM
UPDATED: October 21, 2009  5:27 PM

Answer Wiki:
No, you've got it, if there is a one-to-one ratio (one record in FileB would only match one record in FileA). We would often write an audit report listing the records deleted and perhaps why others weren't We would code it with an input parameter so you could ('R') just run the report ('U') run the report and update the file. And then what happens to the entries in file b Phil ---------------------- CharlieBrown I think this "if criteria met" will require that program acquire the record test values and if they are ok then delete. Phil ----------------------
Last Wiki Answer Submitted:  October 21, 2009  5:27 pm  by  philpl1jb   44,630 pts.
All Answer Wiki Contributors:  philpl1jb   44,630 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

If you just want to delete and it is definitely a 1 to 1 releationship,
instead of doing a chain and checking if found, you can just do a delete.
If it is a one to many relationship, you can put the delete in a DO Loop

 33,695 pts.