I have the requirement to compare the two files and pick up
the matching records.
File 1. file2
23 32
32 13
34 15
35 36
36 35
43
Get the matching records from this 2 files to out file. how
you will do this in cobol program?
Answer Posted / nnn
First sort the both files through JCL or internal sort.
Then follow below logic in the program.
Read file1
Read file2
perform until end-of file1 OR end-of file2
if file1 = file2
write a matched record to output
read file1
read file2
end-if
if file1 < file2
read file1
end-if
if file1 > file2
read file2
end-if
End-perform.
Is This Answer Correct ? | 117 Yes | 8 No |
Post New Answer View All Answers
Name the divisions, which are available in a cobol program?
Which division and paragraphs are mandatory for a COBOL program?
What is the difference between goback, stop run and exit program in cobol?
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
Are you comfortable in cobol or jcl?
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
What are different data types in cobol?
how to refer the data field?
What is perform what is varying?
example for sub strings ? and refernce modifications whit output pls
In COBOL programming, what is PERFORM? What is VARYING?
What is Pic 9v99 Indicates in COBOL?
What is link edit in cobol?
how do you reference the variable unblock file formats from cobol programs
Explain the configuration section of a cobol program with examples of syntax.