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

Optimal usage of Joinkeys


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Gururajan Balaji

New User


Joined: 10 Jan 2011
Posts: 6
Location: Chennai

PostPosted: Fri Jan 21, 2011 3:59 pm
Reply with quote

Hi All,
I Have to compare 2 files on (1,9 bytes) and get matching records from file2.

First file lrecl=10,recfm=fb -> Has no dups on key (May contain 1 million records)
second file lrecl=274,recfm=fb --> has dups on key (may contain 500 million records or more)
both the files are sorted on key.

I use the below sort card for comparison.

Code:

  JOINKEYS FILE=F1,FIELDS=(1,9,A),SORTED         
  JOINKEYS FILE=F2,FIELDS=(4,9,A),SORTED         
  REFORMAT FIELDS=(F2:1,274)                     
  SORT FIELDS=(4,9,CH,A) 


The problem is file2 is a very huge file (may contain 500 million records) and hence the job runs for a very long time.
Is there a way to optimize this sort? (Like allocating maximum size for buffer).
Few of my colleagues are suggesting me to go for COBOL instead of SORT for such a huge file comparison.
Could some one tell me which method could be optimal?
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Fri Jan 21, 2011 7:01 pm
Reply with quote

If file two is already sorted on the key, then why not use

Code:

  SORT FIELDS=COPY


to do a COPY instead of a SORT?

I would think this in itself will improve performance.

I do not think Cobol would work nearly as well.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Jan 22, 2011 2:20 am
Reply with quote

In addition to doing a COPY instead of a SORT (as suggested by Dave), I would also try reversing the files so the file with dups and more records is used as F1 to see if that performs better:

Code:

...
//FB274 DD DSN=...  input file2 (FB/274)
//FB10 DD DSN=...  input file1 (FB/10)
...
  JOINKEYS F1=FB274,FIELDS=(4,9,A),SORTED
  JOINKEYS F2=FB10,FIELDS=(1,9,A),SORTED
  REFORMAT FIELDS=(F1:1,274)
  SORT FIELDS=COPY
Back to top
View user's profile Send private message
Gururajan Balaji

New User


Joined: 10 Jan 2011
Posts: 6
Location: Chennai

PostPosted: Mon Jan 24, 2011 2:39 pm
Reply with quote

Thanks Dave & Frank.
Will there be an Improvement in performance if I use PARM='CORE=MAX'?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 25, 2011 12:13 am
Reply with quote

CORE=MAX is equivalent to MAINSIZE=MAX which is the shipped default for DFSORT so you won't see any difference unless your site has changed the shipped default. Since I don't know what your site defaults are, I can't tell you if CORE=MAX will have any effect.
Back to top
View user's profile Send private message
David Eisenberg

New User


Joined: 15 Nov 2007
Posts: 39
Location: New York

PostPosted: Tue Jan 25, 2011 8:01 pm
Reply with quote

>I would also try reversing the files so the file with dups and more records is used as F1 to see if that performs better<

Frank,

Can you tell us a little more about what prompted this suggestion? Are there generally-applicable performance considerations when choosing which file should be F1 and which should be F2 in a JOIN when one (or both) of the files is very large?

Thanks,

David
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 25, 2011 11:54 pm
Reply with quote

The only thing I can say is that using F1 for the file that has "more" duplicates may result in more efficient processing. I can't really be more specific than that as it depends on a lot of factors. The only way to know for sure is to try it both ways.
Back to top
View user's profile Send private message
David Eisenberg

New User


Joined: 15 Nov 2007
Posts: 39
Location: New York

PostPosted: Wed Jan 26, 2011 12:11 am
Reply with quote

Frank,

That's helpful; thanks.

David
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts STEM usage in REXX CLIST & REXX 14
No new posts Sort with JOINKEYS using two VB files DFSORT/ICETOOL 1
Search our Forums:

Back to Top