Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Remove bunch of duplicates in a PS file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sreekantham

New User


Joined: 15 Sep 2008
Posts: 5
Location: BANGALORE

PostPosted: Fri Jan 07, 2011 10:13 am    Post subject: Remove bunch of duplicates in a PS file
Reply with quote

Hi,

Currently i am having a problem to remove duplicates from a file.

Assume the file is in the below format

315412345678901201001345A2H
315412345678901202CRT AKP 43567001 AB CLIENT
315412345678901205999999 888888888666666
3154123456789012076K2 H45
3154123456789012087KAP
315412345678901209 21324567
315412345678901210A425 000000J01
315412345678901213K 62 141810
315412345678901214Z 6
315412345678901215K
315412345678901218ABC.SAMPLEIN

315412345678901301001345A2H
315412345678901302CRT AKP 43567001 AB CLIENT
315412345678901305999999 888888888666666
3154123456789013076K2 H45
3154123456789013087KAP
315412345678901309 21324567
315412345678901310A425 000000J01
315412345678901313K 62 141810
315412345678901314Z 6
315412345678901315K
315412345678901318ABC.SAMPLEIN

315412345678901201001345A2H
315412345678901202CRT AKP 43567001 AB CLIENT
315412345678901205999999 888888888666666
3154123456789012076K2 H45
3154123456789012087KAP
315412345678901209 21324567
315412345678901210A425 000000J01
315412345678901213K 62 141810
315412345678901214Z 6
315412345678901215K
315412345678901218ABC.SAMPLEIN

In this i need to remove duplicates, the key to be used here is 123456789012 whic is coming from 5th column onwards in the input file.

Just to explain furthur - 5cloumn onwards in record 1 and record 3 are same hence in the output file i need to write only the first occurance of the record that is entry 1 and duplicate shoould not be present in the output file.

Please let me know how to achieve this...
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jan 07, 2011 10:49 am    Post subject:
Reply with quote

Hello and welcome to the forum,

Suggest you sort the file by "the key" and then read the file discarding duplicates as they are encountered.

If the only requirement is the removal of the duplicates, you might consider using your sort product.
Back to top
View user's profile Send private message
sreekantham

New User


Joined: 15 Sep 2008
Posts: 5
Location: BANGALORE

PostPosted: Fri Jan 07, 2011 11:31 am    Post subject: Remove bunch of duplicates in a PS file
Reply with quote

Thanks for the earliest reply.

This file is having so many other records with different formats as well and once i sort we may loose the record order that is i need to remove only second ... occurance and not the first one. Please let me know if there is any other option available to remove the group of duplicates.

Secondly this file is having some 1000 records, the key will be different in each records and the order of the records should not change except the duplicates.

Please help...
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jan 07, 2011 11:37 am    Post subject:
Reply with quote

Hello,

Until you much more clearly explain all of the rules and possible data formats, no one will be able to help very much.

You need to make sure yoiu post all of the information and not have the requirement "grow" as replies are posted.

To preserve the original sequence of the retained records, you could use an "original record number" in the intermediate file and re-sort by the original record number for the final output.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us