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 u handle errors in BMS macro
What are the pertinent COBOL
Discuss about changing dataset name in proc.
Which is not true about evaluate statement
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 is a scope terminator give example?
what are decleratives in cobol?
What is the default value(s) for an initialize and what keyword allows for an override of the default?
Whats the difference between search & search ALL?
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
What are various search techniques in cobol? Explain.
What is Pic 9v99 Indicates in COBOL?
Write a cobol program making use of the redefine clause.
What is the difference between binary search and sequential search?
Explain how you can characterize tables in cobol?