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 difference between perform … with test after and perform … with test before?
how do you reference the esds vsam file formats from cobol programs
How do you get the data to code the BMS macro?
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.
Difference between array and sub-script ?
Give some examples of command terminators?
what happens if parmparameter passes zero bytes to the program
What is a scope terminator give example?
What are the rules of the move verb?
What are the cobol coding sheets?
How to know whether the module is dynamical or statistical?
How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?
What are the various section in data division and briefly explain them.
Can we change the password using ALTER? anyone tried and changed?
how do you reference the ksds vsam file formats from cobol programs