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
explain sorting techniques in cobol program?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
Discuss about changing dataset name in proc.
When is inspect verb is used in cobol?
Are you comfortable in cobol or jcl?
What is rmode(24)
What are different data types in cobol?
What is the default value(s) for an initialize and what keyword allows for an override of the default?
Explain the configuration section of a cobol program with examples of syntax.
how to access the file from prodution from changeman tool and to submit a file to production
How do define dynamic array in cobol.
Give some examples of command terminators?
How are the next sentence and continue different from each other?
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
What are declaratives and what are their uses in cobol?