View previous topic :: View next topic
|
Author |
Message |
saujanya_2831
New User
Joined: 09 May 2007 Posts: 27 Location: pune
|
|
|
|
15) file1 & file2 contains records
FILE1 FILE2 FILE3
1 2
2 4
3 6
4 7
5 8
if file1 & file 2 record matches then file3 writes matched records .(each & every record of file1 should compare with each record of file2) |
|
Back to top |
|
|
balakrishna reddy
Active User
Joined: 13 Jul 2007 Posts: 128 Location: Guntur
|
|
|
|
hi saujanya,
this topic is already discussed i think.
Code: |
procedure division.
open input infile1.
open output outfile.
perform read-infile-1 thru read-infile-1-exit until eof1 = 'y'
close infile1 outfile.
stop run.
read-infile-1.
read infile1 at end move 'y'y to eof1.
open input infile2.
move 'n' to eof2.
perform read-infile-2 thru read-infile-2-exit until eof2 = 'y'.
close infile2.
read-infile-1-exit.
exit.
read-infile-2.
read infile2 at end move 'y' to eof2.
if (val1 = val2)
move val1 to val3
write outrec
move 'y' to eof2.
read-infile-2-exit.
exit.
|
i didn't mentioned working-storage section,declarations should be according to the usage. |
|
Back to top |
|
|
|