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
 

 

form a file from two sortedfiles who have repetative inputs

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: form a file from two sortedfiles who have repetative inputs
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Mon May 05, 2008 8:01 pm    Post subject: Reply to: form a file from two sortedfiles who have repetati
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

Site Director


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

PostPosted: Tue May 06, 2008 6:42 am    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue May 06, 2008 11:30 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue May 06, 2008 11:42 am    Post subject: Reply to: form a file from two sortedfiles who have repetati
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    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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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