Suppose, file A has 100 records and file B has 500 records. We
want to write records common to both A and B into file C and
records which are present only in either A or B into another file D.
What should be the logic of Cobol program to achieve this?

Answer Posted / shrik

Sort both file A and B using the Key in ascending order..
Then read File A and B..
Compare records read frm A and B
If found Equal write into File C (common records)
If NOT write into file D

Is This Answer Correct ?    6 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc

2105


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

690


Explain how you can characterize tables in cobol?

638


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

672


State the various causes of s0c1, s0c5 and s0c7.

665






) what is the difference between AID and HANDLE AID?

1637


Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

676


How do u write test cases?

1638


Which Search verb is equivalent to PERFORM…VARYING?

686


What is the problem of ordered sequential files access?

702


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?

1230


How to use the same COBOL program in Batch and CICS on lines? explain with an example

1914


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?

897


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.

3720


How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?

744