|
Hi, create the second file with a unique key over all fields that can contain duplicates. In your RPG program, read the first file and try to write to the second one (with the unique key). On the write statement set the Error/Lower Indicator. If you try to write a duplicate error, the indicator is set *ON and the record gets not written. For all other records, the indicator stays off and the record gets written. Mit freundlichen Gru?en / Best regards Birgitta "Shoot for the moon, even if you miss, you'll land among the stars." (Les Brown) -----Ursprungliche Nachricht----- Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]Im Auftrag von murali dhar Gesendet: Dienstag, 3. Januar 2006 13:57 An: RPG programming on the AS400 / iSeries Betreff: duplicate rec Hi I have below PF, which daily gets added with several number of records. This file consists several duplicate records(mainly on KEPOLX). With RPG III(no RPGIV, no SQL) I want to create two files from the data of this PF file . First file should consists all duplicate records and second file should consists only unique records by eliminating duplicate records.Please help with some pointers. Thanks for your help, REF(DTAREF) R RGDTRANS KEPOLX 11A KERQSX R REFFLD(RDTARF2/KERQS *LIBL/ POLTYX R REFFLD(POLTY) PETIDX 5A KESTSX R REFFLD(RDTARF2/KESTS *LIBL/ PRTXTX 256A --------------------------------- Yahoo! DSL Something to write home about. Just $16.99/mo. or less -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.