I want to remove a duplicates form a given input field using cobol program. please Any one help me out to solve this ... Thanks in Advance.
Answer Posted / naveenkumar m
As few answered for VSAM file dedup, I will explain for PS flat files,
1) Make sure your file is sorted either Ascending or descending using SORT.
2)FIRST-READ PARA
READ INPUT-FILE INTO WS-ARRAY()
UNTIL EOF
ARRAY-COUNT=ARRAY-COUNT + 1
3)PERFORM COMPARE-PARA VARYING I FROM 1 BY 1 UNTIL I < ARRAY-COUNT
IF WS-ARRAY(I)=WS-ARRAY(I+1) THEN
WRITE DUPLICATE-RECORDS
ELSE
WRITE NODUPLICATE-RECORDS
END-PERFORM
=====================================
I just given algorithm not exact code....
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
For rewrite, why is it mandatory that file needs to be opened?
Why did you choose to work with ibm mainframe cobol programming?
How can you get the ksds file records into your cobol program?
Name the sections present in data division.
How many bytes S(8) comp field occupy and its maximum value?
Can we change the password using ALTER? anyone tried and changed?
What is redefines clause in COBOL?
What is Pic 9v99 Indicates in COBOL?
What is the problem of ordered sequential files access?
How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?
how to access the file from prodution from changeman tool and to submit a file to production
Explain about different table spaces.
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.