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


Please Help Members By Posting Answers For Below Questions

How did the release of cobol/370 version 1.3 improve the performance of release 1.1?

645


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

1958


What is the use of intialize verb?

751


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.

934


Describe the cobol database components?

682






what is difference between cobol and cobol/400

21570


Define static linking and dynamic linking.

669


How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

1949


What is a scope terminator give example?

659


How many bytes S(8) comp field occupy and its maximum value?

1634


What are the access modes of START statement?

719


Difference between cobol and cobol-ii?

713


How do you reference the following file formats from cobol programs?

696


What is the Purpose of POINTER Phrase in STRING command in COBOL?

723


Which is not true about evaluate statement

1595