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
 

 

Removing duplicates based on two positions using ICEOOL

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

New User


Joined: 08 Jun 2009
Posts: 15
Location: Bangalore

PostPosted: Thu Jul 02, 2009 8:25 am    Post subject: Removing duplicates based on two positions using ICEOOL
Reply with quote

Hi,

I have a flat file which will have a number of records. Each record has length 80.

My requirement is to remove records where duplicates can occur in positions 10-20 and 30-40. That is if two records have same value in positions 10-20 and 30-40 (remaining positions need not have same values), then those records should be eliminated.

Is this possible using icetool ? If yes, how ?

Thanks in advance.
Back to top
View user's profile Send private message

bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Thu Jul 02, 2009 10:05 am    Post subject:
Reply with quote

Hi ,
Please try the below code in ICETOOL

Code:
SELECT FROM(IN) TO(OUT) ON(10,10,CH,.30,10,CH) NODUPS
Back to top
View user's profile Send private message
harithb

New User


Joined: 08 Jun 2009
Posts: 15
Location: Bangalore

PostPosted: Thu Jul 02, 2009 10:55 am    Post subject: Reply to: Removing duplicates based on two positions using I
Reply with quote

Yes. I tried it and it is working. Thank you.

But I have a problem here. The input file has a header and a trailer which will always have spaces from position 15 till 80. And since they are the same in these positions (having spaces in both header and trailer) both of them are getting deleted in the output file icon_sad.gif

The trailer is identified by the first position 'Z'. The trailer should have the count of number of records in the output file and I think I can use COUNT and again write one more output file in a new step after the step having removal of duplicate records.

But how should I be handling the header record. The header record is identified by the first position which is always an 'A'.
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 Jul 02, 2009 8:49 pm    Post subject:
Reply with quote

Please show an example of the records in your input file and what you expect for output.

Give the RECFM of the input file.
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 Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
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


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