MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Remove duplicates but ignore specific columns

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Nork1
Beginner


Joined: 22 Jan 2004
Posts: 4
Topics: 2

PostPosted: Fri Jan 23, 2004 6:10 am    Post subject: Remove duplicates but ignore specific columns Reply with quote

Hi.

I've been trying unsuccessfully to come up with a method of comparing records in a file and removing any in which data matches on parts of those records.


REC1 AGBNC#GB01DAY A NCU1 003 PGBNCA0D N
REC2 AGBNC#GB01DAY A NCU1 007 PGBNCA1D N
REC3 BGBNC#GB01DAY A NCU2 003 BGBNCA0D N
REC4 BGBNC#GB01DAY A NCU2 007 BGBNCA1D N
REC5 BGBNC#GB01DAY A NCU2 009 BGBNCA3D N

In the example above I want to ignore characters in columns 1, 23 and 29 (bold characters).
Ignoring these columns, records 1 and 3 match and are counted as duplicates as are records 2 and 4. The only non-matching record is 5 which is to be written to an output file.

Unfortunately I'm only a beginner on ICETOOL and my attempts so far have proved unsuccessful. Your help will be greatly appreciated.

Thanks!
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Jan 23, 2004 6:56 am    Post subject: Reply with quote

Nork1,

The following JCL will give you the desired results. The postions you want to eliminate are 1, 20, 26 ( as shown by you in bold) . so you can specify the sort fields without them and get the desired results.

Code:

//STEP0100 EXEC PGM=ICETOOL                                             
//TOOLMSG   DD SYSOUT=*                                                 
//DFSMSG    DD SYSOUT=*                                                 
//IN        DD *                                                       
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
AGBNC#GB01DAY A NCU1 003 PGBNCA0D N                                     
AGBNC#GB01DAY A NCU1 007 PGBNCA1D N                                     
BGBNC#GB01DAY A NCU2 003 BGBNCA0D N                                     
BGBNC#GB01DAY A NCU2 007 BGBNCA1D N                                     
BGBNC#GB01DAY A NCU2 009 BGBNCA3D N                                     
//TOOLIN    DD *                                                       
  SELECT FROM(IN) TO(OUT) ON(2,18,CH) ON(21,5,CH) ON(27,10,CH) NODUPS   
//OUT      DD SYSOUT=*                                                 
//*                                                                     


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nork1
Beginner


Joined: 22 Jan 2004
Posts: 4
Topics: 2

PostPosted: Fri Jan 23, 2004 7:13 am    Post subject: Reply with quote

Kolusu,

Thanks for the prompt response... much appreciated!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group