Page 1 of 1

Join on multiple fields

PostPosted: Tue May 25, 2010 11:21 pm
by mainframe_novice
Is it possible to join 2 files based on multiple fields ?
So far I have used only one field to do the join on 2 files .

Also the how would be a performance if we are comparing the 2 files having a million records each .

I would appreciate if simple example is posted to demonstrate how the join based on multiple fields work .

Re: Join on multiple fields

PostPosted: Wed May 26, 2010 12:00 am
by Alissa Margulies
Joining on multiple fields works the same as joining on a single field.
For example:
JOINKEYS FILES=F1,FIELDS=(1,5,A,26,7,A)
JOINKEYS FILES=F2,FIELDS=(1,5,A,26,7,A)

If you need further assistance, then please provide more detailed information regarding your requirements, such as RECFM and LRECL of each input file, position and lengths of KEY fields to be JOINed, and what you want included in the output records.

Re: Join on multiple fields

PostPosted: Wed May 26, 2010 1:03 am
by mainframe_novice
Thanks for your reply .

I have around 8-10 fields which can be used in Join .

I was curious about performance .
How it would work when 2 files involved have million rows each .

Re: Join on multiple fields

PostPosted: Wed May 26, 2010 1:12 am
by Alissa Margulies
Its not the number of records in each file that you need to focus on, but rather the number of duplicate keyed records. The file with more duplicate keyed records should be coded as SORTJNF1.