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
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.
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