IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Match program needed to produce non matching records


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jcbrowser

New User


Joined: 06 Oct 2005
Posts: 12

PostPosted: Thu Mar 29, 2007 12:34 am
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Mar 29, 2007 12:57 am
Reply with quote

Hello,

If you look around in the forum, you will see examples of this.

It has been requested several ltimes.
Back to top
View user's profile Send private message
jcbrowser

New User


Joined: 06 Oct 2005
Posts: 12

PostPosted: Thu Mar 29, 2007 1:20 am
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Thu Mar 29, 2007 2:53 pm
Reply with quote

I think you havent searhed properly.
See below link to get logic to achieve what you want:
http://ibmmainframes.com/viewtopic.php?t=16924&highlight=file+compare
You will find MANY similar threads if you search carefully.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Mar 29, 2007 3:00 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Mar 29, 2007 3:24 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Using API Gateway from CICS program CICS 0
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top