I have a File that has duplicate records. I need only those
records that occur more than thrice.
Answer Posted / brian
Sort the file in ascending order of your duplicated fields.
You can write a COBOL module to read the file sequentially.
Set up a dup-counter in Working Storage. Set up a group of
fields in Working Storage to hold duplicated fields. They
should be similar to what you are sorting on. Save each
records read fields after reading it. When you read the
current record compare it to the saved fields. If they
match add to your dup-counter. If they don't match zero
out your counter. After adding to your counter check the
value. If > 1 you have a 3rd duplicate. Write that record
to a duplicate output file. Hope I'm close to getting you
an answer.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
what is the JCL statement consists of?
What is the maximum length of a single line of jcl?
by using cond parameter maximum 8 cond can be coded in single cond means ?explain
How to execute 2nd and 4th steps among 5 steps in jcl proc?
How can a fb file convert to vb file using sort program?
Differentiate between the joblib and the steplib statements?
Many jcl statements contain specific values designed to direct and control the execution of the statement. What are these fields called?
what is the use of IEBGENER utility?
what is the compile process of cobol program expalin with code
Explain how can return codes be tested before execution of a job step?
Can we call instream to catalog and catalog to instream?
Which dd parameters are required?
How to submit a jcl from cics?
How does jcl act on a cobol code?
whats the diff bw the evaluate also and and?