There are two flat files one having 10 records and other
having 5 records. write a cobol pgm to find the duplicate
records(matching records)from both files.



There are two flat files one having 10 records and other having 5 records. write a cobol pgm to fi..

Answer / talluri

perform 10 times
read file1
perform 5 times
read file2
if file1rec = file2rec
write file1rec to file3rec
end-if
end perform
end perform.

Is This Answer Correct ?    5 Yes 1 No

Post New Answer

More COBOL Interview Questions

01 a pic x(6) value is abcdef 01 b pic x(3) move a to b wht will be the value in b ?

3 Answers   Patni,


I have two sequential files, FILE-1 and FILE-2. FILE-1 contains 2 columns(A,B) and FILE-2 contains 3 columns (C,D,E).I want an output file, FILE-3 which has all five columns with duplicates eliminated from column A.

3 Answers  


if a pic 9(3) value 354,b pic x(2) value '46' then a)a>b 2)a<b 3)error

8 Answers   Cap Gemini,


Following questions were asked in Capegemini on 8th sep,2012 mainframe test 1.)Condition code for dul recors in VSAM- 2.) Is NULL or =NULL in Select statement 3.)max size of CI 4.)What happens after CI is full 5.)Ques on COND parameter 6.)which among following can not be rolled back a)delete table b.)droptable c)Update d.)insert 7.)groupby and orderby sql querries 8.)Max extents in VSAM file 9.)quesn on DPRTY=(1,10) 10.)range of condition codes in COBOL 11.)occurs clase can not be used at which level? 12.)delimiter in jcl 13.)sort card for file in PGM=SORT 14.)PIC(6) value 120056 possible? 15)question on BLKSIZE Is (20,20) and (20,10) possible? 16.)number of bytes in RDF 17.)Can we use index in WS-section or LK-section 18.)Verify command in IDCAMS used for? 19.)question on Alternate Index 20.)Return code of file attribute mismatch 21.)In which format COBOL variables stored? 22.)what is Alternate of HANDLE? 23.)can SUM,AVG,MIN,ROUND used in numeric and char variable data types? 24.)What is the datatype of FILE STATUS codes in WS-section?

2 Answers   Cap Gemini,


if a=b how the flow will complete??? perform test through test-exit. perform activa through activa-exit. test. if a=b then next sentence else move a to c. test-exit. exit. activa. -- -- activa-exit. exit.

1 Answers   IBM,






what is Pic 9v99 Indicates?

2 Answers  


What is the difference between a DYNAMIC and STATIC call in COBOL?

2 Answers  


How many bytes will be allocated for the following record description entries? 01 REC-A. 05 A PIC S9(4). 05 B PIC XXXBXXX. 05 C PIC ____9.99. 05 D PIC S9(5) COMP-3. 05 E PIC 9(3) COMP.

16 Answers   IBM, TCS,


S9(5)V9(2) occupies how many bytes memory ?

6 Answers   Cap Gemini,


what is difference between the sysabend and userabend?

2 Answers  


Can we use goto statement in inline_perform ?

5 Answers   IBM,


Difference between ps, esds

3 Answers  


Categories