View previous topic :: View next topic
|
Author |
Message |
jcbrowser
New User
Joined: 06 Oct 2005 Posts: 12
|
|
|
|
I have two files.
Master file and a transaction file.
Master file contains
1
2
3
4
6
Trans file contains
1
3
3
5
5
6
7
I need a program that will match the two files and produce a new tran file that contains only the records that did 'not' have a matching master.
The master file will not have any duplicates.
The new tran file result should contain
5
5
7
Thanks in advance |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you look around in the forum, you will see examples of this.
It has been requested several ltimes. |
|
Back to top |
|
|
jcbrowser
New User
Joined: 06 Oct 2005 Posts: 12
|
|
|
|
Thanks Dick,
I looked in the COBOL forum but there doesn't seem to be any thing that will handle what I want to do.
If you could look at my example and give me a little more help, I would appreciate it.
Thanks |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Take a look at some of the DFSORT examples that have been provided.
A little reading on these forums and the manuals - what more do you need. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
jcbrowser wrote: |
I need a program that will match the two files and produce a new tran file that contains only the records that did 'not' have a matching master.
The master file will not have any duplicates. |
The program you need is very simple. It has been used for many years as a simple teaching exercise.
Assuming both files are are in the same sequence, do a priming read to both files and then loop around a compare of both.
When equal read again, when one is lower read it, when the other is lower, read that one.
Eventually you will have eof on both.
In the loop is where you can determine if the tran file did not have a matching master. |
|
Back to top |
|
|
|