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: 10257
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: 6967
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: 6967
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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