I have a File that has duplicate records. I need only those records that occur more than
thrice.?
Answer Posted / harsha
1 Sort the file on any key
2 Read file sequentially. While reading, store the record
in a working storage temporary variable and add count
counter variable.
3 Every time you read record, compare it with temporary
variable. if it is same increase counter otherwise reset
counter.
4 When counter become greater than three, write record to
an outfile.
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is link edit in cobol?
how do you reference the variable unblock file formats from cobol programs
What is the difference between perform … with test after and perform … with test before?
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
What is the difference between comp and comp-3?
What is the difference between PIC 9.99 and 9v99 in COBOL?
i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
What are the pertinent COBOL commands?
what are decleratives in cobol?
Can we redefine the field of x(200) to less than 200?
What is perform what is varying?
I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......
What happens when we move a comp-3 field to an edited (say z (9). Zz-)?