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
 

 

Eliminate and retain duplicates

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Thu Feb 18, 2010 12:58 am    Post subject: Eliminate and retain duplicates
Reply with quote

Was not able to find this one on the forum......

Requirement is to eliminate duplicates from an input file, and also store the duplicates in a different file.

1. Input file. LRECL = 528. Fixed block. LRECL = 27456.

Cols 1-15, 74-79 and 87-93 are the columns to be used to eliminate duplicates.


2. First Output file. LRECL = 528.Fixed block. LRECL = 27456

Order does not matter. File will have unique records.
When retaining the unique record, the first record amongst the duplicates can be retained, though it does not matter


3. Second Output file. LRECL = 528.Fixed block. LRECL = 27456

Order does not matter. File will have the duplicate records.

Example shown below-

1. Input file with following records- only data for the three columns shown below-

cols 1-15 cols 74-79 cols 87-93

111111111111111 aaaaaa uuuuuuu
111111111111111 aaaaaa uuuuuuu
111111111111111 aaaaaa uuuuuuu
222222222222222 aaaaaa uuuuuuu
333333333333333 aaaaaa uuuuuuu
111111111111111 bbbbbb sssssss
111111111111111 bbbbbb sssssss
444444444444444 bbbbbb ddddddd
--------------------------------------------------------------
2. First Output file with unique records will have following records-

111111111111111 aaaaaa uuuuuuu
222222222222222 aaaaaa uuuuuuu
333333333333333 aaaaaa uuuuuuu
111111111111111 bbbbbb sssssss
444444444444444 bbbbbb ddddddd

------------------------------------------------------------

3. Second Output file will show the duplicate records eliminated from the first Output file.

111111111111111 aaaaaa uuuuuuu
111111111111111 aaaaaa uuuuuuu
111111111111111 bbbbbb sssssss

So, number of records in input file = number of records in First Output file + number of records in Second Output file.
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Feb 18, 2010 1:56 am    Post subject:
Reply with quote

Suresh Shankarakrishnan,

The following DFSORT/ICETOOL JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//IN       DD DSN=Your input file,DISP=SHR
//UNQ      DD SYSOUT=*                                         
//DUPS     DD SYSOUT=*                                         
//TOOLIN   DD *                                                 
  SELECT FROM(IN) TO(UNQ) ON(1,15,CH) ON(74,6,CH) ON(87,7,CH) -
  FIRST DISCARD(DUPS)                     
//*
Back to top
View user's profile Send private message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Thu Feb 18, 2010 2:07 am    Post subject:
Reply with quote

Thanks Skolusu, it works . icon_smile.gif
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts SAS - RETAIN statement Musab Ahmed IBM Tools 2 Thu Jan 28, 2016 1:02 pm
No new posts how to eliminate records from operati... PUMA DFSORT/ICETOOL 5 Tue Dec 23, 2014 4:42 pm


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