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 usage of comp fields in cobol?
what is difference between cobol and cobol/400
What are various search techniques in cobol? Explain.
How do you get the data to code the BMS macro?
How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?
A table has two indexes defined. Which one will be used by the SEARCH?
What is the difference between perform … with test after and perform … with test before?
When is inspect verb is used in cobol?
What is comp-1 and comp-2?
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
What are the pertinent COBOL
i want a program using by if, evaluate , string, unstring, perform, occurs?
how do you reference the printer file formats from cobol programs
What is the difference between a binary search and a sequential search what are the pertinent cobol?