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 does it mean by Restart and Checkpoint in JCL ? How are checkpoints being taken and what is their usage ? How to use Checkpoint macro on a JOBSTEP ?
how do you create a dataset in a jcl with the same file organisation as that of another existing dataset?
what happens in execution stage in job processing?
Name the parameters which can be used to limit the number of records written to a sysout dataset?
What are steplib and joblib?
A chkpt is the parameter coded for multi-volume qsam datasets in a dd statement. When a chkpt is coded as chkpt=eov, a checkpoint is written to the dataset specified in the sysckeov statement at the end of each volume of the input/output multi-volume dataset. State whether true or false?
what is the use of JCL?
What are the utility programs in jcl?
In sms datasets, what is the function of the dd mgmtclas keyword?
Explain how can a stopped job be started again?
How to pass data to a program that is coded in an exec statement?
How to submit a jcl from cics?
How to override a dsn that is contained in a proc called by another proc? I need to do the override in the calling jcl?
Which dd parameters are required?
What do you understand by jcl?