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

correction to #3
sort files Asc

if f1 = f2
move file1-rec to file3-rec. write file3-rec
read f1 & f2.
if f1 < f2
move file1-rec to file4-rec. write file4-rec.
read f1.
if f1 > f2
move file2-rec to file4-rec. write file4-rec
read f2.

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What kind of error is trapped by on size error option?

953


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

934


HOw can I get the negative sign while deduct high value from low value

2005


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?

1410


What is a scope terminator give example?

831


What is cobol?

946


How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

964


What guidelines should be followed to write a structured cobol prgm?

863


What is the use of intialize verb?

969


Have you used comp and comp-3 in your project? And how?

2205


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

2126


how do you reference the variable block file formats from cobol programs

928


I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.

1350


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

863


Explain what you understand by passing by value.

909