Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 74
Location: US

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: 7314

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

Senior Member


Joined: 08 May 2006
Posts: 1004
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: 7314

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: 10388
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: 1784
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: 74
Location: US

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 COB2 file processing rizwanaccy COBOL Programming 8 Tue Jan 02, 2018 1:00 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts Preserve order in Input File pshongal DFSORT/ICETOOL 13 Thu Dec 21, 2017 4:20 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us