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
In which area will you utilize 88 level items in cobol?
What is cobol?
What is inspect in cobol ?
How do you differentiate between cobol and cobol-ii?
What is length is cobol?
State the various causes of s0c1, s0c5 and s0c7.
What is the difference between structured cobol programming and object alternativelyiented cobol?
what is difference between cobol and cobol/400
how do you reference the fixed unblock file formats from cobol programs
Explain about different table spaces.
How arrays can be defined in COBOL?
Mention the guidelines to write a structured cobol program?
I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
What is a report item?