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 / soumya santosini patnaik

first load the files in shorted order after that code a
matching program. in the procedure division check the file1
entry with file2 entry if file1 entry = file2 entry then
then write to o/p file end-evaluate esle check for file1<
file2 (if yes then the pointer is brought down to the 2nd
rec of file1 and checked with 1st rec of file2 when the
para is performed for 2nd time),if the above condition is
false then it checks if file1>file2 if yes then pointer is
brought down to the next entry of file2 and checked with
1st entry of file1 with 2nd entry of file2 in next perform
and the process is done till the end of records.

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a report item?

741


How can you get the ksds file records into your cobol program?

642


what is difference between cobol and cobol/400

21562


Explain about different table spaces.

648


What is a scope terminator give example?

655






i want a program using by if, evaluate , string, unstring, perform, occurs?

4057


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?

2098


what is the difference between COBOL2 AND COBOL390?

2453


INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?

419


What is the difference between next sentence and continue in cobol programing language?

708


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

652


I have a File that has duplicate records. I need only those records that occur more than thrice.?

8652


Name some of the examples of COBOl 11?

2684


What is the Purpose of Pointer in the string?

643


What is the difference between Global and External Variables?

666