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
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
What is the difference between structured cobol programming and object alternativelyiented cobol programming?
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
How you can read the file from bottom?
What is amode(24)?
what is amode(24), amode(31), rmode(24) and rmode(any)?
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
How do u write test cases?
What is difference between static and dynamic call in cobol?
Name the sections present in data division.
what is s000 u4087 error? please give the all error codes in cobol,jcl.
what are decleratives in cobol?
What is the difference between a binary search and a sequential search what are the pertinent cobol?
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
what happens if parmparameter passes zero bytes to the program