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 the difference between comp and comp-3?
Why would you use find and get rather than to obtain?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
How can we find that module can be called – whether DYNAMICALLY or STATICALLY?
Define static linking and dynamic linking.
What are the rules of the move verb?
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?
how do you reference the printer file formats from cobol programs
How do we get current date from system with century in COBOL?
What is the Purpose of Pointer in the string?
how can i see junk values in dclgen or in hostvariable of comp ?
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
How do define dynamic array in cobol.
What is the compute verb? How is it used?
What are the pertinent COBOL