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

form a file from two sortedfiles who have repetative inputs


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

New User


Joined: 05 May 2008
Posts: 5
Location: mumbai

PostPosted: Mon May 05, 2008 7:55 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon May 05, 2008 8:01 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue May 06, 2008 6:42 am
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue May 06, 2008 11:03 am
Reply with quote

Quote:

BUT STRICLY(DUE TO PERFORMANCE REASONS) NO FILES CAN BE OPENED AND CLOSED SEPARATELY FOR EACH COMPARISION.


i smell bs!
Back to top
View user's profile Send private message
ashesh choudhury

New User


Joined: 05 May 2008
Posts: 5
Location: mumbai

PostPosted: Tue May 06, 2008 11:17 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue May 06, 2008 11:30 am
Reply with quote

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. . . icon_smile.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue May 06, 2008 11:39 am
Reply with quote

that has nothing to do with performance. that is just dumb code.
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: Tue May 06, 2008 11:42 am
Reply with quote

Quote:
that is just dumb code
That's a big 10-4 icon_cool.gif

Amazing how many times that "solution" is used, though. . . Kinda scary.

d
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 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
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top