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 / kalone

First load both the files into 2 arrays and then sort them
on say ASC criteria and then take the first element from 1
file and compare with the element of other file , if
matches write into Outfile ,like wise we can keep on
reading & comparing till we get all the matching values in
the outfile.

Is This Answer Correct ?    6 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the access modes of START statement?

719


explain sorting techniques in cobol program?

686


What are different data types in cobol?

688


Write some characteristics of cobol as means of business language.

619


how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

1929






what is the difference between COBOL2 AND COBOL390?

2453


How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

796


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1903


How do you define a variable of comp-1 and comp-2?

701


How do define dynamic array in cobol.

670


What is redefines clause in COBOL?

848


How many bytes S(8) comp field occupy and its maximum value?

1630


I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?

1804


Explain the configuration section of a cobol program with examples of syntax.

659


What is the utilization of copybook in cobol?

657