Delete duplicate members from a physical file using RPGLE

5 pts.
Tags:
Physical File
RPGLE
Hi, could someone please help me with the code to delete duplicate records from a physical file. Please post with the full code.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta

    Welcome to ITKE. It's not clear what problem you are having.

    Are you asking us to write a complete program for you (for free) and you aren't telling us anything about the file? Do you have a definition of "duplicate"? Are entire rows duplicated or are there simply duplicate keys that need to be resolved? Your question title refers to "duplicate members"; is that a reference to a multi-member file that has some members with data the same as some unknown number of other members? If some rows (or some members) are removed, are there criteria to determine which one is not removed?

    It's almost guaranteed not to do you any good, but here's an example of a RPG program that removes duplicates:

          /free
    
           exec sql  CREATE TABLE MYLIB/NONDUPE as
                         (SELECT DISTINCT * FROM MYLIB/DUPES) WITH DATA ;
    
           exec sql  DELETE FROM  MYLIB/DUPES ;
    
           exec sql  INSERT INTO MYLIB/DUPES SELECT * FROM MYLIB/NONDUPE ;
    
           *INLR = *ON ;
           return ;
    
          /end-free

    I don't see how that could help you, though. Much more information is needed to make such a program useful, and it's probably not a good way to do the work.

    Tom

    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following