Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to remove duplicates in PS file without cahnging the pos

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ashok_uddaraju

New User


Joined: 21 Feb 2007
Posts: 70
Location: bangalore

PostPosted: Wed Jan 25, 2012 3:31 pm    Post subject: How to remove duplicates in PS file without cahnging the pos
Reply with quote

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
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Wed Jan 25, 2012 3:35 pm    Post subject: Reply to: How to remove duplicates in PS file without cahngi
Reply with quote

You have Syncsort?

Have you searched here, used google, tried anything you'd like to let us know about?
Back to top
View user's profile Send private message
elango_K

New User


Joined: 18 Aug 2011
Posts: 44
Location: India

PostPosted: Wed Jan 25, 2012 5:06 pm    Post subject:
Reply with quote

ICETOOL :
Try this

Code:

//TOOLIN DD *                                       
  SELECT FROM(FILE1) TO(SORTOUT) ON(1,20,CH) FIRST 


define your length accordingly icon_smile.gif
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 988
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Jan 25, 2012 6:40 pm    Post subject:
Reply with quote

elango_K wrote:
ICETOOL :
Try this

Code:

//TOOLIN DD *                                       
  SELECT FROM(FILE1) TO(SORTOUT) ON(1,20,CH) FIRST 


define your length accordingly icon_smile.gif


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
View user's profile Send private message
elango_K

New User


Joined: 18 Aug 2011
Posts: 44
Location: India

PostPosted: Wed Jan 25, 2012 8:04 pm    Post subject:
Reply with quote

Hi Garry,

My mistake. icon_sad.gif

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Wed Jan 25, 2012 8:41 pm    Post subject:
Reply with quote

Garry Carroll wrote:
[...] and drop the SEQNUM during output processing. This gives the remaining records in the original order.

Garry.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Jan 25, 2012 10:08 pm    Post subject: Reply to: How to remove duplicates in PS file without cahngi
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Jan 25, 2012 10:28 pm    Post subject: Re: Reply to: How to remove duplicates in PS file without ca
Reply with quote

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
View user's profile Send private message
elango_K

New User


Joined: 18 Aug 2011
Posts: 44
Location: India

PostPosted: Wed Jan 25, 2012 11:22 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Jan 26, 2012 12:20 am    Post subject:
Reply with quote

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
View user's profile Send private message
ashok_uddaraju

New User


Joined: 21 Feb 2007
Posts: 70
Location: bangalore

PostPosted: Thu Jan 26, 2012 8:40 am    Post subject:
Reply with quote

Thanks, i am able to get the result
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us