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
 

 

A question on search and writing matched and unmatched rec.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Mon Jan 25, 2010 10:41 am    Post subject: A question on search and writing matched and unmatched rec.
Reply with quote

Hi all,

i have two files File1 that has 1 million records and File2 that has 10 thousand records.

Requirement : File3 shall contain matched records from File1 & File2.
File4 shall contain unmatched records from File1 & File2.

Since the records are in million please let me know the most optimized way to achieve this.


Thank you.
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: Mon Jan 25, 2010 11:00 am    Post subject:
Reply with quote

Hello,

First - both files need to be in the same key sequence. If they are not aleady in sequence, they need to be sorted.

Next - download the 2-file match/merge code from the "Sticky" near the top of the COBOL part of the forum.

Then, modify the sample code to meet your requirement.
Back to top
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Mon Jan 25, 2010 11:26 am    Post subject:
Reply with quote

Sure DS.
Back to top
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Mon Jan 25, 2010 11:32 am    Post subject:
Reply with quote

DS.. i saw the code..... let me please know whether this is the optimized way to for files having 1 Million records ?


Thank you.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10277
Location: italy

PostPosted: Mon Jan 25, 2010 11:39 am    Post subject: Reply to: A question on search and writing matched and unmat
Reply with quote

There is not much to optimize in a two file match program!

since You posted in the COBOL forum without telling anything more specific
You got a COBOL answer with a pointer to a generic two files match solution

certainly a <any sort product > solution will give better <performace wise> results

there are zillions samples around, just search the sort and jcl forums
Back to top
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Mon Jan 25, 2010 11:45 am    Post subject:
Reply with quote

Fine enrico.
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: Mon Jan 25, 2010 8:30 pm    Post subject:
Reply with quote

Hello,

The posted sample code processes in the same amount of time as it takes to merely read the files. . . I use this for files with multiple hundred millioin records. . .

If the ONLY result needed is the simple match/merge, you might want to consider using the sort (as mentioned earlier). If there is additional business processing needed, you many want to consider adding this to the match/merge code saving multiple passes of the file(s) - which is where the time would be wasted. . .

Deciding which is the proper way to implement is not "fixed" - sometime the utility is better, sometime the code is better.
Back to top
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Wed Jan 27, 2010 9:54 am    Post subject:
Reply with quote

Thank you DS.
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: Wed Jan 27, 2010 10:51 am    Post subject: Reply to: A question on search and writing matched and unmat
Reply with quote

You're welcome - good luck icon_smile.gif

d
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 Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts The Last Two Question For You To Ask ... CaptBill Mainframe Interview Questions 0 Fri Apr 14, 2017 5:42 am
No new posts Asynchronous CICS Processing Question moezbud CICS 1 Mon Mar 06, 2017 6:13 pm


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