Rexx code to delete duplicate records



IBM's Command List programming language & Restructured Extended Executor

Rexx code to delete duplicate records

Postby ravisankarc » Fri May 02, 2014 7:10 pm

Hi,

I want a rexx code which can identify and delete the duplicate records. I searched in previous topics but couldn't find a relevant one.

Thanks in advance.

Regards
Ravi
ravisankarc
 
Posts: 47
Joined: Thu Aug 27, 2009 2:18 am
Has thanked: 0 time
Been thanked: 0 time

Re: Rexx code to delete duplicate records

Postby enrico-sorichetti » Fri May 02, 2014 7:43 pm

I want a rexx code which can identify and delete the duplicate records.


You might want it... but You will not get it :evil:
this is a help forum, not a gimme something one.

search the forum on how to do it using sort
gazillions of examples around
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Rexx code to delete duplicate records

Postby ravisankarc » Fri May 02, 2014 8:26 pm

Hi Enrico,

I know deleting duplicate records using DFSORT, but I am looking a rexx code to do this. Because the other part of my requirement has been coded in rexx and don't want to use DFSORT in between.

Regards
Ravi
ravisankarc
 
Posts: 47
Joined: Thu Aug 27, 2009 2:18 am
Has thanked: 0 time
Been thanked: 0 time

Re: Rexx code to delete duplicate records

Postby enrico-sorichetti » Fri May 02, 2014 8:47 pm

does not seem that much difficult to me

here is the logic

read one record into the old_record_buffer
do while more records left
    read one record into the new_record_buffer
    /* compare old and new */
    if old < new then
        move new to old
        iterate/continue
    if old = new
       process as needed
       iterate/continue
   if old > new
      take care of the error ( out of sequence )
end
process the record left ( the old one  )
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Rexx code to delete duplicate records

Postby enrico-sorichetti » Fri May 02, 2014 9:26 pm

:oops: forgot to write the record

instead of
    if old < new then
        move new to old


should be
    if old < new then
        write the old record
        move new to old
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post