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
How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?
What are the different rules for performing sort operation?
how do you reference the printer file formats from cobol programs
Write the code to count the sum of n natural numbers.
In which area will you utilize 88 level items in cobol?
What is the Purpose of Pointer in the string?
How you can characterize tables in cobol?
In COBOL, what is the different between index and subscript?
What is the local-storage section?
IF I mention stop run in CICS what happens?
What are the rules of the move verb?
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
What is rmode(any) ?
How can we find that module can be called – whether DYNAMICALLY or STATICALLY?
How are the next sentence and continue different from each other?