5 pts.
 RPG 3 duplicate record error handler
The physical file has a field keyed and unique. If i want to update these to RPG 3 program it is showing a duplicate record error. Does anybody have solution? tell me the command to handle this error only for RPG 3.

Software/Hardware used:
ASKED: October 17, 2008  5:23 AM
UPDATED: August 27, 2010  7:57 AM

Answer Wiki:
Hello By using CHGPF u can update in Physical file,so that u can update the program u r Rpg program When already the datbase iS Set with UNIQUE AND KEY FIELD SO U CANNOT DO DIRECTILY CHANGE SO fIRST change the database so that it i seasy to do
Last Wiki Answer Submitted:  October 17, 2008  2:41 pm  by  126   170 pts.
All Answer Wiki Contributors:  126   170 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

Hi,

You can add an an error indicator to your WRITE operation code in your RPG – then the program won’t stop on duplicate records – if an error occurs when executing the write operation the indicator will be switched on – then you can condition what you do in your program using the indicator.

Normally I would write the duplicate records to an error file or ignore them (depending on what they are).

Regards,

Martin Gilbert.

 23,625 pts.

 

No one should be updating RPG III code. Convert it to RPG IV if you need answers. Use the CVTRPGSRC command to do the conversion, then ask how to handle duplicate keys correctly.

Continued maintenance of RPG III is a professional disservice to the employer.

Tom

 108,260 pts.