Page 1 of 1
Remove Duplicates and get output unsorted.
Posted: Sun Oct 13, 2013 8:47 pm
by Pragya
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?
Re: Remove Duplicates and get output unsorted.
Posted: Mon Oct 14, 2013 4:25 am
by William Collins
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.
Posted: Sun Mar 09, 2014 4:29 pm
by Pragya
I know it's very late to reply on this - but can i still follow up?
Re: Remove Duplicates and get output unsorted.
Posted: Sun Mar 09, 2014 7:46 pm
by William Collins
Yes.
Re: Remove Duplicates and get output unsorted.
Posted: Sun Mar 09, 2014 11:11 pm
by Pragya
Sample input is, RECFM=FB, LRECL=80:
Code: Select all
MOHANK 123456789012345 RAJES
ANTAKS 123456789012345 MIRAJ
MOHANK 123456789012345 NANAK
Re: Remove Duplicates and get output unsorted.
Posted: Mon Mar 10, 2014 5:23 am
by William Collins
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,
Re: Remove Duplicates and get output unsorted.
Posted: Mon Mar 10, 2014 2:12 pm
by zprogrammer
For the given input
Code: Select all
MOHANK 123456789012345 RAJES
ANTAKS 123456789012345 MIRAJ
MOHANK 123456789012345 NANAK
Do you need output like
Code: Select all
MOHANK 123456789012345 RAJES
ANTAKS 123456789012345 MIRAJ
or
Code: Select all
ANTAKS 123456789012345 MIRAJ
MOHANK 123456789012345 NANAK
Re: Remove Duplicates and get output unsorted.
Posted: Mon Mar 31, 2014 8:25 pm
by Pragya
The first one is I need, Pandora Box.
Re: Remove Duplicates and get output unsorted.
Posted: Mon Mar 31, 2014 8:33 pm
by zprogrammer
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