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
how can a gdg base be created in a jcl. What is the difference between empty and scratch parameter while defining/altering gdg base?
What do you understand by the term notcat 2 – gs?
Can anybody tell what is tool used to generate the list of PROCS used in JCL to generate a PROCTREE
Is condition checking possible in jcl? If yes, how?
How to code these statements in JCL: CLEANUP INITIAL(NO) RESTART(NO) DYNALLOC(NO) job definition..?
Can we use DISP=SHR in output file in JCL
What is NOTCAT ?
Explain the function of dd name parameter with a 2 part structure; audit.report?
What is the purpose of dd dummy statement?
in ways data can be passed to a COBOL program from JCL?
How can return codes be tested before execution of a job step?
a dd statement has 2 types of parameters. Name them?
What is the function of the steplib dd statement?
What is 'mounting' of volumes ? Is there anything that a programmer can do in it ? How to find currently mounted volume ?
What is the purpose of the dd keylen parameter?