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

EVALUATE KEY1 > KEY2 ALSO KEY2 < KEY1
WHEN FALSE ALSO FALSE
READ F1 NEXT RECORD
READ F2 NEXT RECORD
WHEN TRUE ALSO FALSE
READ FILE1 NEXT RECORD
WHEN FALSE ALSO TRUE
READ FILE2 NEXT RECORD
END-EVALUATE

Is This Answer Correct ?    3 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?

1808


How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

1005


Explain how to differentiate call by context by comparing it to other calls?

689


Explain about different table spaces.

651


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

644






What are the different open modes available in cobol?

722


Can we redefine the field of x(200) to less than 200?

822


i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com

1773


how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

1931


What is report-item in COBOL?

711


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

1525


how do you reference the esds vsam file formats from cobol programs

634


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

661


What is comp-1 and comp-2?

766


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

673