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
What rules are to be followed while using the corresponding options?
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
What is the compute verb? How is it used?
input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
Discuss about changing dataset name in proc.
How many sections are there in data division in COBOL?
What are the different rules of SORT operation?
What is length is cobol?
What is the difference between Call and a Link?
How do u write test cases?
What is a SSRANGE and NOSSRANGE?
What is the difference between external and global variables in COBOL?
How do we get current date from system with century in COBOL?
Define static linking and dynamic linking.