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
What is amode(31)
) How do u handle errors in BMS macro
Which Search verb is equivalent to PERFORM…VARYING?
what is amode(24), amode(31), rmode(24) and rmode(any)?
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
How do get the result of your program directly on your pc?
What kind of error is trapped by on size error option?
Why would you use find and get rather than to obtain?
What is the difference between goback, stop run and exit program in cobol?
what is the use of outrecord?
how do you reference the variable unblock file formats from cobol programs
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
What guidelines should be followed to write a structured cobol prgm?
What is inspect in cobol ?
How many sections are there in data division in COBOL?