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

read all the records of file1 and load into array

read the record of second file one at a time and search for
the value in the array(table) using search

if the value of the file matches with the value in the table
then write that record to output file

Is This Answer Correct ?    1 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

For rewrite, why is it mandatory that file needs to be opened?

623


Which Search verb is equivalent to PERFORM…VARYING?

688


Why would you use find and get rather than to obtain?

692


what is amode(24), amode(31), rmode(24) and rmode(any)?

705


What are the different data types in cobol?

800






What are the different types of condition in cobol and write their forms.

660


How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.

3722


here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?

6837


How to print 10 to 1 if the input have only 10 digit number?

813


how we sort two input files based on a common column and giving one o/p file please send me the coding logic?

1657


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

1846


Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?

825


How do you reference the following file formats from cobol programs?

696


Write a program to enter and display the names of students in a class using the occurs clause.

654


Write a program to explain size error.

677