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 / michar de papachuil

This might help you here but you have to Sort the two files
first before doing the match.

IF File1 = File2
PERFORM 2400-MATCH-BOTH-FILES THRU 2400-EXIT
PERFORM 2100-READ-FILE1 THRU 2100-EXIT
PERFORM 2200-READ-FILE2 THRU 2200-EXIT

ELSE

IF I-GROUP-SUBSYSTEM LESS THAN I-MODULE-SUBSYSTEM
PERFORM 2600-UNKNOWN-FILE1-VALUES THRU 2600-EXIT
PERFORM 2100-READ-FILE1 THRU 2100-EXIT
ELSE
PERFORM 2500-UNKNOWN-FILE2-VALUES THRU 2500-EXIT
PERFORM 2200-READ-FILE2 THRU 2200-EXIT
END-IF

Is This Answer Correct ?    0 Yes 1 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

2104


Explain about different table spaces.

648


i need a small 3d program using inline and outline.

1637


State the various causes of s0c1, s0c5 and s0c7.

661


What is redefines clause in COBOL?

848






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

796


IF I mention stop run in CICS what happens?

1896


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

664


What is the difference between Call and a Link?

696


What are various search techniques in cobol? Explain.

645


Write a program to enter and display the names of students in a class using the occurs clause.

652


Write a cobol program making use of the redefine clause.

731


Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?

716


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

631


Name the divisions, which are available in a cobol program?

685