Page 1 of 1

JOIN on 3 files ?

PostPosted: Sun Jan 30, 2011 11:35 pm
by syannigeri
Hi Team,

Can we perform Join on 3 files at a time and get the matching records??
Also, is it possible to join N number of files using JOIN KEYS ??

Thanks
Shankargouda

Re: JOIN on 3 files ?

PostPosted: Mon Jan 31, 2011 2:19 am
by dick scherrer
Hello,

How many records are in each of the files?

The documentation mentions 2 files.

What does "matching" mean to you for this question? That the "key" exists in all 3 files or that the key exists in mor than one file?

Re: JOIN on 3 files ?

PostPosted: Mon Jan 31, 2011 9:23 pm
by Alissa Margulies
SyncSort for z/OS supports joining 2 files at a time. Once you JOIN 2 of the files, you can use that output to JOIN with the 3rd file.

Re: JOIN on 3 files ?

PostPosted: Tue Feb 01, 2011 12:02 am
by syannigeri
ohh !! I am now joining 2 files and then merging with rest... CPU is burning like anything..
So was thinking of alternatives...

May be i will move to COBOL. I can merge 3 files in a single shot with less CPU cost..

Thanks
Shankargouda

Re: JOIN on 3 files ?

PostPosted: Tue Feb 01, 2011 1:00 am
by Alissa Margulies
If you are simply merging the records from 3 files into a single file, then SyncSort can do that in one step. But if you require actual JOIN processing, then 2 files at a time is the limit. What exactly are you attempting to do? Please provide sample input and output records and I would be happy to futher assist you. Please also answer Dick's question regarding how you are defining "matching".

Re: JOIN on 3 files ?

PostPosted: Tue Feb 01, 2011 11:20 pm
by syannigeri
I have 3 files. I need to match on Account number.. Assume the account number is first 13 digits..
If it matches.. Then need to Append the as below.

Account number; First file data;Second file data;3rd file data.

Will this be possible in SORT ?

Thanks
Shankargouda

Re: JOIN on 3 files ?

PostPosted: Wed Feb 02, 2011 12:08 am
by Alissa Margulies
Can there be duplicate account numbers in any of the files?

Re: JOIN on 3 files ?

PostPosted: Wed Feb 02, 2011 12:22 am
by syannigeri
No, I will take care of Removing them.
Will it become complex if Duplicates are there ?

Re: JOIN on 3 files ?

PostPosted: Wed Feb 09, 2011 3:02 am
by Alissa Margulies
If you perform a 2-step JOIN (not a JOIN and then MERGE), then I would not expect the CPU time to spike as you have described. If you would like further tuning assistance with this SORT application, please feel free to contact Syncsort Mainframe Product Services directly at zos_tech@syncsort.com or call +1(201)930-8260.