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 / ajay kumar ande
OPEN INPUT FILE1
OPEN INPUT FILE2
OPEN OUTPUT FILE3
MOVE 'N' TO EOF
PERFORM UNTIL EOF='S'
READ FILE1 AT END MOVE 'S' TO EOF
READ FILE2 AT END MOVE 'S' TO EOF
IF EMPNO1 = EMPNO2
MOVE
REC2 TO REC3
WRITE REC3
END-PERFORM.
CLOSE FILE1, FILE2, FILE3.
Is This Answer Correct ? | 10 Yes | 11 No |
Post New Answer View All Answers
How do you reference the following file formats from cobol programs?
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
) How do u handle errors in BMS macro
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
how to convert the recors form vsam file to db2 table tru file aid
Why would you use find and get rather than to obtain?
i need a small 3d program using inline and outline.
How do you reference the fixed block file formats from cobol programs
Write down the divisions of cobol program?
how to access the file from prodution from changeman tool and to submit a file to production
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
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
Whats the difference between search & search ALL?
What is the difference between comp and comp-3 usage?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)