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
what is the use of outrecord?
Describe the cobol database components?
Can we change the password using ALTER? anyone tried and changed?
What is an in line perform? When would you use it? Anything else you wish to say about it.
Which division and paragraphs are mandatory for a COBOL program?
Define cobol?
Can a Search can be done on a table with or without Index?
What is the difference between structured cobol programming and object alternativelyiented cobol?
What is amode(31)
How you can read the file from bottom?
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
Write a program to enter and display the names of students in a class using the occurs clause.
i need a small 3d program using inline and outline.
What is the use of intialize verb?
What is the difference between a binary search and a sequential search what are the pertinent cobol?