View previous topic :: View next topic
|
Author |
Message |
ashok_uddaraju
New User
Joined: 21 Feb 2007 Posts: 72 Location: US
|
|
|
|
Hi,
I have a PS file which has input like
abcd
abcd
1/2/3
11:23:24
defg
defg
3/4/5
10:34:56
asdf
asdf
7/5/8
12:34:57
Expected output is :
abcd
1/2/3
11:23:24
defg
3/4/5
10:34:56
asdf
7/5/8
12:34:57
I just want to remove duplicate entries without changing the postion of rest.Can you please suggest on this ? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You have Syncsort?
Have you searched here, used google, tried anything you'd like to let us know about? |
|
Back to top |
|
|
elango_K
New User
Joined: 18 Aug 2011 Posts: 44 Location: India
|
|
|
|
ICETOOL :
Try this
Code: |
//TOOLIN DD *
SELECT FROM(FILE1) TO(SORTOUT) ON(1,20,CH) FIRST
|
define your length accordingly |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
elango_K wrote: |
ICETOOL :
Try this
Code: |
//TOOLIN DD *
SELECT FROM(FILE1) TO(SORTOUT) ON(1,20,CH) FIRST
|
define your length accordingly |
will SORT the records - which the TS did NOT want.
I suggest adding a SEQNUM to the records during INREC processing, then SORT with SUM FIELDS=NONE to drop duplicates. Next, SORT based on the SEQNUM that was added and drop the SEQNUM during output processing. This gives the remaining records in the original order.
Garry.
Garry. |
|
Back to top |
|
|
elango_K
New User
Joined: 18 Aug 2011 Posts: 44 Location: India
|
|
|
|
Hi Garry,
My mistake.
Code: |
//SYSIN DD *
SORT FIELDS=(1,39,CH,A)
INREC IFTHEN=(WHEN=INIT,OVERLAY=(40:SEQNUM,8,ZD))
SUM FIELDS=NONE
|
Sort this output agin.
Code: |
//SYSIN DD *
SORT FIELDS=(40,8,ZD,A)
|
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Garry Carroll wrote: |
[...] and drop the SEQNUM during output processing. This gives the remaining records in the original order.
Garry. |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
the main problem is that the proposed solution will get rid of ALL duplicates
( wherever they might occur ) not just the contiguous ones
anyway here are the sort control cards for the task
Code: |
000023 OPTION COPY
000024 INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,80)))
000025 OUTFIL INCLUDE=(81,8,ZD,EQ,1),BUILD=(1,80)
|
|
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
enrico-sorichetti wrote: |
the main problem is that the proposed solution will get rid of ALL duplicates
( wherever they might occur ) not just the contiguous ones |
The TS failed to tell us if non-contiguous duplicates are expected or what should be done if they occur. Therefore, he is in the position of consuming what we choose to dish up. |
|
Back to top |
|
|
elango_K
New User
Joined: 18 Aug 2011 Posts: 44 Location: India
|
|
|
|
If the idea is to delete all the duplicates and to maintain the order,
Can this be achieved in a single step ?
If so, how? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
will SORT the records - which the TS did NOT want. |
You can have the SELECT operator of DFSORT's ICETOOL avoid a SORT by specifying a COPY. For example:
Code: |
//TOOLIN DD *
SELECT FROM(FILE1) TO(SORTOUT) ON(1,20,CH) FIRST USING(CTL1)
//CTL1CNTL DD *
OPTION COPY
|
In this case, only the contiguous duplicates will be affected. |
|
Back to top |
|
|
ashok_uddaraju
New User
Joined: 21 Feb 2007 Posts: 72 Location: US
|
|
|
|
Thanks, i am able to get the result |
|
Back to top |
|
|
|