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 Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm


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