IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Two file processing at a time


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dp33770

New User


Joined: 04 Jul 2007
Posts: 91
Location: Hyderabad

PostPosted: Fri Dec 26, 2008 3:43 pm
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: 459
Location: Belgium

PostPosted: Fri Dec 26, 2008 4:12 pm
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: 91
Location: Hyderabad

PostPosted: Fri Dec 26, 2008 4:33 pm
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: 459
Location: Belgium

PostPosted: Fri Dec 26, 2008 4:44 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Dec 26, 2008 6:13 pm
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
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
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

Moderator Emeritus


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

PostPosted: Sat Dec 27, 2008 12:41 am
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: 91
Location: Hyderabad

PostPosted: Sat Dec 27, 2008 2:13 am
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: 459
Location: Belgium

PostPosted: Sat Dec 27, 2008 3:26 am
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

Moderator Emeritus


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

PostPosted: Sun Dec 28, 2008 7:38 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top