Remove duplicate records from File-1



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Remove duplicate records from File-1

Postby jaganmoni » Mon Sep 01, 2014 4:26 pm

Hi,

I have two FB files (File-1 & File-2) with length 163 bytes. In both files only the first record is header record and remaining all records are data records.

Now I have to compare data records of File-1 and File-2 based on Key and removes duplicates from File-1 and writes File-1 without duplicates. While doing the compare I have to compare only data records.
The Key (Starts from position: 19 to 45 (27 bytes) & 9 to 11 (3 bytes)) type is zoned decimal with total length 30 bytes.
The records from File-1 should be excluded only if the data from position 19 to 45 of File-1 should be equal to File-2 and the data from position 9 to 11 should be either 300 or 310 or 320 or 330 ore 340 in both File-1 and File-2.
jaganmoni
 
Posts: 6
Joined: Tue Oct 28, 2008 12:13 am
Has thanked: 0 time
Been thanked: 0 time

Re: Remove duplicate records from File-1

Postby jaganmoni » Mon Sep 01, 2014 5:20 pm

Please see below for example:
File1: The Kay value from position 19 to 45 is '005145151513532007606058527'
----+----1----+----2----+----3----+----4----+----5----+----6
********************************* Top of Data **************
CISPLT1 201408272014082720392823 TOE3JH06
00760241100ADDSPL00051451515135320076060585271140827 0183225
00760241140ADDSPL00051451515135320076060585271140827 0183225
00760241160ADDSPL00051451515135320076060585271140827 0183225
00760241162ADDSPL00051451515135320076060585271140827 0183225
00760241164ADDSPL00051451515135320076060585271140827 0183225
00760241168ADDSPL00051451515135320076060585271140827 0183225
00760241180ADDSPL00051451515135320076060585271140827 0183225
00760241300ADDSPL00051451515135320076060585271140827 0183225
00760241310ADDSPL00051451515135320076060585271140827 0183225
00760241320ADDSPL00051451515135320076060585271140827 0183225
00760241330ADDSPL00051451515135320076060585271140827 0183225
00760241340ADDSPL00051451515135320076060585271140827 0183225
00760241400ADDSPL00051451515135320076060585271140827 0183225
00760241420ADDSPL00051451515135320076060585271140827 0183225

File2: The Kay value from position 19 to 45 is '005145151513532007606058527'
----+----1----+----2----+----3----+----4----+----5----+----6
00760241100CHGSPL00051451515135320076060585271140827,0183225
00760241162CHGSPL00051451515135320076060585271140827 0183225
00760241164CHGSPL00051451515135320076060585271140827 0183225
00760241168CHGSPL00051451515135320076060585271140827 0183225
00760241180CHGSPL00051451515135320076060585271140827 0183225
00760241300CHGSPL00051451515135320076060585271140827 0183225
00760241310CHGSPL00051451515135320076060585271140827 0183225

Note: In the above example only two records from position 9 to 11 should have either 300 or 310 or 320 or 330 ore 340 in both File-1 and File-2
The following two records should be excluded from File-1
00760241310ADDSPL00051451515135320076060585271140827 0183225
00760241320ADDSPL00051451515135320076060585271140827 0183225

So the final output will be as below
Output:
CISPLT1 201408272014082720392823 TOE3JH06
00760241100ADDSPL00051451515135320076060585271140827 0183225
00760241140ADDSPL00051451515135320076060585271140827 0183225
00760241160ADDSPL00051451515135320076060585271140827 0183225
00760241162ADDSPL00051451515135320076060585271140827 0183225
00760241164ADDSPL00051451515135320076060585271140827 0183225
00760241168ADDSPL00051451515135320076060585271140827 0183225
00760241180ADDSPL00051451515135320076060585271140827 0183225
00760241300ADDSPL00051451515135320076060585271140827 0183225
00760241330ADDSPL00051451515135320076060585271140827 0183225
00760241340ADDSPL00051451515135320076060585271140827 0183225
00760241400ADDSPL00051451515135320076060585271140827 0183225
00760241420ADDSPL00051451515135320076060585271140827 0183225
jaganmoni
 
Posts: 6
Joined: Tue Oct 28, 2008 12:13 am
Has thanked: 0 time
Been thanked: 0 time

Re: Remove duplicate records from File-1

Postby jaganmoni » Mon Sep 01, 2014 5:24 pm

I am sorry. I have given wrong output.
The following two records should be excluded from File-1
00760241300ADDSPL00051451515135320076060585271140827 0183225
00760241310ADDSPL00051451515135320076060585271140827 0183225

So the final output will be as below
Output:
CISPLT1 201408272014082720392823 TOE3JH06
00760241100ADDSPL00051451515135320076060585271140827 0183225
00760241140ADDSPL00051451515135320076060585271140827 0183225
00760241160ADDSPL00051451515135320076060585271140827 0183225
00760241162ADDSPL00051451515135320076060585271140827 0183225
00760241164ADDSPL00051451515135320076060585271140827 0183225
00760241168ADDSPL00051451515135320076060585271140827 0183225
00760241180ADDSPL00051451515135320076060585271140827 0183225
00760241320ADDSPL00051451515135320076060585271140827 0183225
00760241330ADDSPL00051451515135320076060585271140827 0183225
00760241340ADDSPL00051451515135320076060585271140827 0183225
00760241400ADDSPL00051451515135320076060585271140827 0183225
00760241420ADDSPL00051451515135320076060585271140827 0183225
jaganmoni
 
Posts: 6
Joined: Tue Oct 28, 2008 12:13 am
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post