Remove Duplicates and get output unsorted.
Remove Duplicates and get output unsorted.
Hi,
I have a file and I need to remove duplicates records from it.When the duplicates are removed, I need an output file that is unsorted, the order of input records should not change.
Is this possible using SORT?
I have a file and I need to remove duplicates records from it.When the duplicates are removed, I need an output file that is unsorted, the order of input records should not change.
Is this possible using SORT?
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Remove Duplicates and get output unsorted.
Do you only want duplicates which are consecutive removed, or if record number one is the same as the last record on the file, you want the last record removed? Either can be done, but the coding would be different, so need to know. Can you show representative sample input, and required output, please? Also let us know the RECFM and LRECL.
Re: Remove Duplicates and get output unsorted.
I know it's very late to reply on this - but can i still follow up?
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Remove Duplicates and get output unsorted.
Sample input is, RECFM=FB, LRECL=80:
Code: Select all
MOHANK 123456789012345 RAJES
ANTAKS 123456789012345 MIRAJ
MOHANK 123456789012345 NANAK
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Remove Duplicates and get output unsorted.
We need all the questions answered, and sample input and expected output which cover the all the conditions. In the sameple you have shown, there are no duplicate records even,
-
- Global Moderator
- Posts: 588
- Joined: Wed Nov 20, 2013 11:53 am
- Location: Mars
Re: Remove Duplicates and get output unsorted.
For the given input
Do you need output like
or
Code: Select all
MOHANK 123456789012345 RAJES
ANTAKS 123456789012345 MIRAJ
MOHANK 123456789012345 NANAK
Code: Select all
MOHANK 123456789012345 RAJES
ANTAKS 123456789012345 MIRAJ
Code: Select all
ANTAKS 123456789012345 MIRAJ
MOHANK 123456789012345 NANAK
zprogrammer
-
- Global Moderator
- Posts: 588
- Joined: Wed Nov 20, 2013 11:53 am
- Location: Mars
Re: Remove Duplicates and get output unsorted.
You could achieve this by DFSORT
1.Step 1 => Add sequence number and sort to eliminate duplicates
2.Step 2 => Sort the sequence numbers and OUTREC the needed data
1.Step 1 => Add sequence number and sort to eliminate duplicates
2.Step 2 => Sort the sequence numbers and OUTREC the needed data
zprogrammer
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute