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 and the record also ?

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

Active User


Joined: 05 Oct 2005
Posts: 309
Location: Vizag / US

PostPosted: Wed Mar 15, 2006 4:53 pm    Post subject: How to remove Duplicates and the record also ?
Reply with quote

Hi all,

I have a query,

Using XSUM i'll remove the dplicate records, and the requirement is i need to delete the that particular record also for which duplicates are present.

Ex:
Input
------------
AAABBB
CCCDDD
ABCDEF
CCCDDD
AAABBB
EEEFFF

Output:
----------
ABCDEF
EEEFFF

Hope u understood, can this be done using SYNCSORT
or any other approach is also welcome, then i have check whether that particular utility is there in my shop or not.

Thanks in Advance,
Back to top
View user's profile Send private message

martijn

New User


Joined: 09 Mar 2006
Posts: 14
Location: The Netherlands

PostPosted: Wed Mar 15, 2006 8:32 pm    Post subject:
Reply with quote

I don't know how to do this in one step, but, using DFSORT, i can do it in three:
step 1: add a '1' at the end of each record, so input looks like this:

AAABBB 1
CCCDDD 1
ABCDEF 1
CCCDDD 1
AAABBB 1
EEEFFF 1

Step 2: summarize on the added field, so the output looks like this:

AAABBB 2
CCCDDD 2
ABCDEF 1
EEEFFF 1

Step 3: now omit all records with a value greater the 1 on the last field, and using OUTREC, remove the last field:

ABCDEF
EEEFFF

I hope this helps. If you want, I can give you the sort-statements to do this with.
[/quote]
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: Wed Mar 15, 2006 9:41 pm    Post subject:
Reply with quote

Quote:
I don't know how to do this in one step, but, using DFSORT, i can do it in three:


You don't need three passes to do it with DFSORT - you can do it in one pass with DFSORT's ICETOOL like this:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,3,CH) NODUPS
/*
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 309
Location: Vizag / US

PostPosted: Wed Mar 15, 2006 11:30 pm    Post subject: Re: How to remove Duplicates and the record also ?
Reply with quote

Thanks a lot Frank Yaeger,

i'll try if ICETOOl is there in our shop.

Can u we do the same thing in SYNCSORT or DFSORT.

Thanks in advance...
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: Wed Mar 15, 2006 11:39 pm    Post subject:
Reply with quote

Gau,

I understand that you have Syncsort, not DFSORT, since you said that in your first post. I only posted the one-pass DFSORT solution to set the record straight because martijn indicated it would take three passes with DFSORT.
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 309
Location: Vizag / US

PostPosted: Wed Mar 15, 2006 11:48 pm    Post subject: Re: How to remove Duplicates and the record also ?
Reply with quote

Thanks to both of u( Frank & martijn) for ur quick replies....
Back to top
View user's profile Send private message
Rameshs

New User


Joined: 15 Jun 2005
Posts: 53
Location: India, Chennai

PostPosted: Thu Mar 23, 2006 12:54 pm    Post subject: Any other method !
Reply with quote

Is there any other method to remove duplicate records without using SORT Utilities (DFSORT/SYNCSORT) ?
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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am


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