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
 
how to elliminate duplicates in cobol?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
vaibhavjadhav

New User


Joined: 27 Jul 2007
Posts: 33
Location: mumbai

PostPosted: Tue Oct 23, 2007 2:06 pm    Post subject: how to elliminate duplicates in cobol?
Reply with quote

hi,

can you please tell me how to elliminate the duplicates in a cobol without using any utility.

please provide me with a brief solution.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Tue Oct 23, 2007 2:23 pm    Post subject: Reply to: how to elliminate duplicates in cobol?
Reply with quote

I guess that the question was asked in the wrong forum !

if the forum is the right one why not use sort

otherwise :
first of all You need to have the records sorted in key order

here is the pseudocode for the main logic:
Code:

( the key could be built from non contiguous fields )
initialize the previous key to low values
do until the end of the input file
   read a record
   build the current key
   if the current key is different from to the previous key then
      write the record
      move the current key to the previous key
   end if
end do
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Oct 23, 2007 2:26 pm    Post subject:
Reply with quote

vaibhavjadhav

1. SORT file based on the KEY
2. Start reading the file,
if the previous KEY is equal to current KEY then don't write to the o/p file;
else write to the o/p 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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm

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