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
How can you get the ksds file records into your cobol program?
What is length is cobol?
) what is the difference between AID and HANDLE AID?
How did the release of cobol/370 version 1.3 improve the performance of release 1.1?
Write the code implementing the perform … varying.
what is the difference between COBOL2 AND COBOL390?
Explain how to differentiate call by context by comparing it to other calls?
What rules are followed by the search verb.
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
Define static linking and dynamic linking.
A table has two indexes defined. Which one will be used by the SEARCH?
What is the difference between goback, stop run and exit program in cobol?
How do get the result of your program directly on your pc?
how do you reference the rrds file formats from cobol programs
What is the Purpose of Pointer in the string?