SMain wrote:I have 2 fields, 1 is of 10 packed and other is 20 ZD ,So I've converted the 2nd field in PD and now I'm trying to join using Syncsort
JOINKEYS FILE=F1,FIELDS=(1,10,A)
JOINKEYS FILE=F2,FIELDS=(2,10,A)
But the probme I'm facing is that since I converted a ZD to PD , I have 'F' in my last nibble whereas in the other file I have 'C' in the last nibble .
I'm not sure if you are showing us exactly what you are doing because in above Sort-statements, for F1 you've the key of length of 9-bytes while for F2 it's 9-bytes. May be a typo but that's what posted on this Forum & one can refer to.
1. I've not verified but conversion from ZD to PD and compare can be done in one step.
2. If now you're dealing with "C" and "F" for the sign nibble, try the below sort:
/STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//PDF DD DSN=Your PDF input file1,DISP=SHR
//PDC DD DSN=Your PDC input file1,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=PDF,FIELDS=(1,10,A)
JOINKEYS F2=PDC,FIELDS=(1,10,A)
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,80,?,F2:1,80)
//JNF1CNTL DD *
INREC OVERLAY=(1:1,10,PD,TO=PDC,LENGTH=10)
//JNF2CNTL DD *
INREC OVERLAY=(1:1,10,PD,TO=PDC,LENGTH=10)
//*