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 cobol coding sheets?

652


What rules are followed by the search verb.

623


Why did you choose to work with ibm mainframe cobol programming?

617


what is the difference between COBOL2 AND COBOL390?

2434


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

399






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?

1217


What rules are to be followed while using the corresponding options?

627


Difference between array and sub-script ?

1147


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

699


Discuss about changing dataset name in proc.

747


How do you get the data to code the BMS macro?

1466


What is the Purpose of Pointer in the string?

630


In COBOL programming, what is PERFORM? What is VARYING?

662


i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?

880


example for sub strings ? and refernce modifications whit output pls

1827