IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Compare duplicate records in same file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pshongal

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Fri Aug 09, 2019 9:37 am
Reply with quote

I have requirement to compare duplicate records (but not all) in the file and remove repeated record.
My Input is as below.

Code:

1111AUREC-1
1111AYREC-2
2222ACREC-3
2222AWREC-4


Output:
Code:

1111AUREC-1
2222ACREC-3
2222AWREC-4


I will have to consider only those duplicate records which has value 'U' and 'Y' in position 6. Key is first 4 bytes. If you see the input, 3rd and 4th records are repeated, but I have to write it as is since the value in position 6 is not U or Y.

Thanks/PS
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 924
Location: Maryland

PostPosted: Fri Aug 09, 2019 6:39 pm
Reply with quote

Tried to understand your requirements. IMHO it has nothing to do with the given example of data, isn't it?

1) If you "have to consider only those duplicate records which has value 'U' and 'Y' in position 6" then why the records keyed '2222' with their values of 'C' and 'W' are included into your output?

2) What, and why, and how is "considered" in two records with key '1111' when producing a single output record?

3) … questions take more space than your data sample, and your description - altogether... icon_question.gif

Please, clarify your requirements - for others to be able to understand them, too.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2567
Location: NYC,USA

PostPosted: Fri Aug 09, 2019 10:00 pm
Reply with quote

Or just use for this type of input data.
Code:
OMIT==(6,1,CH,NE,C’Y’)
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2567
Location: NYC,USA

PostPosted: Fri Aug 09, 2019 10:18 pm
Reply with quote

Use INCLUDE COND=... just a typo correction.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Converting a file from PD to display ... SYNCSORT 4
No new posts Merging more than two records DFSORT/ICETOOL 15
No new posts Matching and non matching records usi... DFSORT/ICETOOL 11
No new posts Record count of RECFM=U tape file DFSORT/ICETOOL 17
This topic is locked: you cannot edit posts or make replies. Write Character to Hexadecimal file w... COBOL Programming 8
Search our Forums:

Back to Top