Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us