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 can i see junk values in dclgen or in hostvariable of comp ?
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
Define cobol?
What is static and dynamic call in cobol?
What is rmode(any) ?
What is report-item in COBOL?
how do you reference the ksds vsam file formats from cobol programs
How many sections are there in data division in COBOL?
What is amode(31)
How arrays can be defined in COBOL?
What is rmode(24)
how do you reference the fixed unblock file formats from cobol programs
Which mode is used to operate the sequential file?
) how do u code after getting data?
How do u write test cases?