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

IN COBOL
IF FILE1>FILE2
READ FILE2
IF FILE1<FILE2
READ FILE1
IF FILE1=FILE2
WRITE FILE3
READ FILE1
READ FILE2.......
IN JCL
//XSUM DD DSN=XSUM.MATCH
//SYSIN DD *
SORT FIELDS=COPY
SUM FIELDS=NONE,XSUM
/*

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

) How do u handle errors in BMS macro

1505


How do define dynamic array in cobol.

669


What is rmode(any) ?

680


What is the Purpose of Pointer in the string?

641


What the difference is between continue and next sentence?

651






can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech

1950


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

1767


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

668


What is rmode(24)

676


Which is not true about evaluate statement

1567


How do you reference the fixed block file formats from cobol programs

701


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


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1900


how do you reference the printer file formats from cobol programs

654


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

2101