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

How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that

2728


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

704


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

1951


How you can read the file from bottom?

658


What is amode(24)?

680






what is amode(24), amode(31), rmode(24) and rmode(any)?

690


Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks

2331


How do u write test cases?

1633


What is difference between static and dynamic call in cobol?

772


Name the sections present in data division.

697


what is s000 u4087 error? please give the all error codes in cobol,jcl.

17027


what are decleratives in cobol?

1827


What is the difference between a binary search and a sequential search what are the pertinent cobol?

727


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

697


what happens if parmparameter passes zero bytes to the program

1659