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

To remove duplicates of a file in cobol program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ch.prashant

New User


Joined: 16 Sep 2006
Posts: 27
Location: Hyderabad

PostPosted: Tue Sep 15, 2009 3:35 pm
Reply with quote

How to remove duplicates from a file in a cobol program.
As iam converting the easytrive code to cobol.
it has a code in easytrive
Code:
SORT COTBLSEL   TO COTBLSLS USING COTBL-GEIS-SEL BEFORE SCREENING 
                                                                   
SCREENING. PROC                                                   
   IF COTBL-NO-OF-SUBM-SEL GT 0 OR +                               
      COTBL-1-X-FOR-EA-PASS-SEL NE '     '                         
      IF COTBL-GEIS-SEL    GT PREV-COTBL-GEIS-SEL                 
         SELECT                                                   
      END-IF                                                       
   END-IF                                                         
      PREV-COTBL-GEIS-SEL = COTBL-GEIS-SEL                         
END-PROC 


in which it removes duplicates and sort the file so i want remove duplicates in the pgm itself and sort it
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 15, 2009 3:52 pm
Reply with quote

Why not move the record to a WORKING-STORAGE field, compare the NEXT record to the WORKING-STORAGE field, and release to the sort if the two are not equal? Isn't that just what the Easytrieve code is doing?
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts Using API Gateway from CICS program CICS 0
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
Search our Forums:

Back to Top