Remove Duplicates and get output unsorted.

IBM's Sort Product, ICETOOL, ICEMAN and ICEGENER.
Post Reply
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

Remove Duplicates and get output unsorted.

Post 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?
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Remove Duplicates and get output unsorted.

Post 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.
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

Re: Remove Duplicates and get output unsorted.

Post by Pragya »

I know it's very late to reply on this - but can i still follow up?
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Remove Duplicates and get output unsorted.

Post by William Collins »

Yes.
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

Re: Remove Duplicates and get output unsorted.

Post by Pragya »

Sample input is, RECFM=FB, LRECL=80:

Code: Select all

MOHANK 123456789012345 RAJES 
ANTAKS 123456789012345 MIRAJ 
MOHANK 123456789012345 NANAK 
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Remove Duplicates and get output unsorted.

Post 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,
zprogrammer
Global Moderator
Global Moderator
Posts: 588
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars

Re: Remove Duplicates and get output unsorted.

Post 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
zprogrammer
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

Re: Remove Duplicates and get output unsorted.

Post by Pragya »

The first one is I need, Pandora Box.
zprogrammer
Global Moderator
Global Moderator
Posts: 588
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars

Re: Remove Duplicates and get output unsorted.

Post 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
zprogrammer
Post Reply

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

Register

Sign in

Return to “IBM DFSort, ICETOOL, ICEMAN, ICEGENER.”