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
 
Two file processing at a time

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

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Fri Dec 26, 2008 3:43 pm    Post subject: Two file processing at a time
Reply with quote

Hi All,
I have two input file each consists of huge no of records.
I need to check every record of File 1 with entire record of File 2.
BUt I cant use File OPEN and CLOSE these many number of times, which is not advisable.

Can anyone tell me if you have any simple solution for this.
Back to top
View user's profile Send private message

PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Fri Dec 26, 2008 4:12 pm    Post subject:
Reply with quote

Sort the two files before than use an utility to compare the files ( DFSORT, SYNCSORT,SuperC, EComp, Comparex, ... )
Back to top
View user's profile Send private message
dp33770

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Fri Dec 26, 2008 4:33 pm    Post subject:
Reply with quote

Its not just compare, I use each record of File1 with every rec of File2 for some more internal processing.
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Fri Dec 26, 2008 4:44 pm    Post subject:
Reply with quote

I don't know what you mean by "huge", but if every record of file 2 is concerned by every record of file 1, what a strange process.

I suspect a poor design. Of course maybe you don't control the data to be processed.
Please ,don't jump too fast into that excuse icon_cool.gif

Can you describe more?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Fri Dec 26, 2008 6:13 pm    Post subject:
Reply with quote

Quote:
I have two input file each consists of huge no of records.
I need to check every record of File 1 with entire record of File 2.
BUt I cant use File OPEN and CLOSE these many number of times, which is not advisable.

Can anyone tell me if you have any simple solution for this.
Depending upon your definition of "huge", you have three choices:
1) Build a table in memory of all records of file 2 and use that table as you read file 1.
2) Use OPEN and CLOSE however many times are needed -- which will really, really, slow down processing and potentially cause system problems.
3) Redesign the process to not require this strange sort of processing.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Dec 26, 2008 11:10 pm    Post subject:
Reply with quote

Hi DeeP,

It might help to give a few examples of the process using "small" files (say 10 recs in one; 12 in the other).

Also provide some other info, e.g. are they both sorted on the same key; is it a 1 to 1 relationship?; many to many; many to many equal numbers of each? etc.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Dec 26, 2008 11:48 pm    Post subject:
Reply with quote

Your description is still a bit vague. Is this a typical "transaction file updating master file" type of task?
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: Sat Dec 27, 2008 12:41 am    Post subject:
Reply with quote

Hello,

Quote:
each consists of huge no of records.
If each file contains 100 million records, the number of records to be compared will be 10,000,000,000,000,000. . . . There is probably not enough mainframe available to service this . . .

As requested, post a small set of the 2 files and explain the processing requirement. Then maybe someone will have a suggestion.
Back to top
View user's profile Send private message
dp33770

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Sat Dec 27, 2008 2:13 am    Post subject:
Reply with quote

First of all I am very sorry for not properly defining my question in appropriate way.

As suggested by you all below is a sample example.
I have a master rec which has suppose the below fields

Master File
------------
Unique_Master_key
Master_data

Ex:
0001 AAAAAA
0002 BBBBBB
0003 CCCCCC

Transaction File
----------------
Transaction_No
Transaction_Data

T001 aaaa
T002 bbbb
T003 cccc
T004 dddd
T005 eeee

Now for each master key and each Transaction no combination I will look for some other field in a table , for ex.

Select * from a table
where Master_key = 0001
and transaction_no = T001

Select * from a table
where Master_key = 0001
and transaction_no = T002

Select * from a table
where Master_key = 0001
and transaction_no = T003
..
..
..
Select * from a table
where Master_key = 0002
and transaction_no = T001

Select * from a table
where Master_key = 0002
and transaction_no = T001

and so on ..
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Sat Dec 27, 2008 3:26 am    Post subject:
Reply with quote

... ???... strange process !

For my info, which kind of process will be triggered by the result of each select.
Too much matching data has no meaning : if anything points on anything, they cannot be specific process.
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: Sun Dec 28, 2008 7:38 am    Post subject:
Reply with quote

Hello,

Quote:
Now for each master key and each Transaction no combination I will look for some other field in a table
I believe not. . . As i mentioned earlier, if the files are "huge", the process will never complete. Also, you mention "some other field" but there is none in your reply.

Your first post mentioned files, but your "sample code" is sql (which is not used with sequential files).

You need to better explain the requirement. What will be done when there is a "match"? What is to be the "output" from this process?
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
This topic is locked: you cannot edit posts or make replies. 00D3003B - time outs in DB2 when invo... chavinash2004 DB2 2 Mon Oct 09, 2017 4:39 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

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