Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 10373
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: 6970
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: 6970
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 File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us