Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Match program needed to produce non matching records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Match program needed to produce non matching records
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

Site Director


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

PostPosted: Thu Mar 29, 2007 12:57 am    Post subject:
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    Post subject:
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: 686
Location: Earth

PostPosted: Thu Mar 29, 2007 2:53 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 29, 2007 3:00 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Mar 29, 2007 3:24 pm    Post subject: Re: Match program needed to produce non matching records
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us