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 did the release of cobol/370 version 1.3 improve the performance of release 1.1?
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
What is the use of intialize verb?
There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.
Describe the cobol database components?
what is difference between cobol and cobol/400
Define static linking and dynamic linking.
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
What is a scope terminator give example?
How many bytes S(8) comp field occupy and its maximum value?
What are the access modes of START statement?
Difference between cobol and cobol-ii?
How do you reference the following file formats from cobol programs?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
Which is not true about evaluate statement