Page 1 of 1

JOINKEYS Different format keys

PostPosted: Thu Apr 02, 2015 10:31 pm
by jself
Hi,
Does anyone know if syncsort can handle different key types.
for ex:
JNF1 - 4 byte packaged field comp
JNF2 - 9 byte zone decimail

000020 //**********************************************************
000021 //SORT03 EXEC PGM=SORT
000022 //SYSUDUMP DD SYSOUT=Y
000023 //SYSOUT DD SYSOUT=*
000024 //SORTJNF1 DD DSN=FILEA,
000025 // DISP=SHR
000026 //SORTJNF2 DD DSN=FILEB,
000027 // DISP=SHR
000028 //SORTOUT DD DSN=FILEC,
000029 // DISP=(NEW,CATLG,DELETE)
000031 //SYSIN DD *
000032 JOINKEYS FILES=F1,FIELDS=(5,4,A)
000033 JOINKEYS FILES=F2,FIELDS=(6,9,A)
000034 JOIN UNPAIRED,F1,F2,ONLY
000035 REFORMAT FIELDS=(F2:1,80)
000036 SORT FIELDS=COPY

output shows everything different.
Thanks for your time.

Re: JOINKEYS Different format keys

PostPosted: Thu Apr 02, 2015 11:17 pm
by BillyBoyo
You need to "normalise" the keys, make them the same length and type.

Which version of SyncSORT do you have. It should tell you in the sysout of the step.

Re: JOINKEYS Different format keys

PostPosted: Thu Apr 02, 2015 11:50 pm
by jself
we are using
SYNCSORT FOR Z/OS 2.1.$.0R

Re: JOINKEYS Different format keys

PostPosted: Fri Apr 03, 2015 12:21 am
by BillyBoyo
Well, that's nice and up-to-date then :-)

You have JNFnCNTL files available to pre-process records before the join takes place:

//JNF1CNTL DD *
  INREC make your key normalised
//JNF2CNTL DD *
  INREC make your key normalised


You won't need to do both, you just need to make one the same format/length as the other.

I'm not sure, since you are using F1,F2,ONLY, that your REFORMAT statement is correct. That is only making a record from the F2 data. Perhaps you can explain. With that, you should get mismatches from F1 and mismatches from F2. Your REFORMAT is indicating you want F2,ONLY.

If that is the case, you can just use INREC BUILD=(sourcepos,sourclength,conversion) to get your keys only for F1.