|
|
| Author |
Message |
ashesh choudhury
New User
Joined: 05 May 2008 Posts: 5 Location: mumbai
|
|
|
|
suppose, file1==>>1,1,2,4,4.
file2==>>2,2,2,3,3,4,5
i need outfile==>2,2,2,4,4(all mathching entries should come with same no of repeatations as in the input file)
BUT STRICLY(DUE TO PERFORMANCE REASONS) NO FILES CAN BE OPENED AND CLOSED SEPARATELY FOR EACH COMPARISION. |
|
| Back to top |
|
 |
References
|
Posted: Mon May 05, 2008 7:55 pm Post subject: Re: form a file from two sortedfiles who have repetative inputs |
 |
|
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 2291 Location: italy
|
|
|
|
why not search the dfsort/icetool or jcl forums for the two files match problem..
dfsort if You are using the IBM dfsort
Jcl if You are using syncsort
or search the dfsort tips and tricks |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6724 Location: 221 B Baker St
|
|
|
|
Hello ashesh choudhury and welcome to the forums,
You may be able to do what you want with your sort product.
If the process needs other cobol logic, i'd suggest you look at the 2-file match/merge "Sticky" near the top of this (cobol) section of the forum. As posted, that sample will do very nearly just what you want.
Download the code, review it, and post back here if you have any questoins. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1050 Location: germany
|
|
|
|
| Quote: |
BUT STRICLY(DUE TO PERFORMANCE REASONS) NO FILES CAN BE OPENED AND CLOSED SEPARATELY FOR EACH COMPARISION.
|
i smell bs! |
|
| Back to top |
|
 |
ashesh choudhury
New User
Joined: 05 May 2008 Posts: 5 Location: mumbai
|
|
|
|
As i have told before..this problem has a serious performance issue..about 70000 records will be handled..so it is very important to use BALANCED LINE algorithm for checking..
the problem is:
FIELD1 FIELD2
file1 1 a
1 b
2 a
2 c
3 d
3 m
4 a
5 a
FIELD1 FIELD2
file2 1 X
2 X
3 X
3 K
4 L
4 G
6 s
the output should be:
FIELD1 FIELD2
outfile 1 a
1 b
1 x
2 a
2 c
2 x
3 d
3 m
3 x
3 k
4 a
4 l
4 g
only ALL common elements should be listed .(eg. 1a,1b,1x..all have to be listed)
BUT STRICLY(DUE TO PERFORMANCE REASONS) NO FILES CAN BE OPENED AND CLOSED SEPARATELY FOR EACH COMPARISION.
i hope the problem is clear now..plz provide solution in a detailed manner.... |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6724 Location: 221 B Baker St
|
|
|
|
Hello,
| Quote: |
| plz provide solution in a detailed manner.... |
Did you review the code mentioned above? As i mentioned earlier - it does what you need.
-->DBZ
This "NO FILES CAN BE OPENED AND CLOSED SEPARATELY FOR EACH COMPARISION" is to prevent the qsam equvilent of a "cartesian product". . . Read fileA record1 - read all of fileB looking for matches, Read fileA record2 - read all of fileB looking for matches, etc. . . Several have found this can eat their system. . .  |
|
| Back to top |
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1050 Location: germany
|
|
|
|
| that has nothing to do with performance. that is just dumb code. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6724 Location: 221 B Baker St
|
|
|
|
| Quote: |
| that is just dumb code |
That's a big 10-4
Amazing how many times that "solution" is used, though. . . Kinda scary.
d |
|
| Back to top |
|
 |
|
|