Page 1 of 1

joinkey with different formats of key

Posted: Thu Apr 26, 2012 11:39 pm
by juares castro
Hi!

I'm trying match 2 files, both VB.

File 1 - key pos 17, packed, 7 bytes, 133 bytes total length
File 2 - key pos 30, unpacked, 13 bytes, 4223 bytes total length

Both have header and trailer.

output 1 - matched records
output 2 - unmatched records of input file1
output 3 - unmatched records of input file2

I'm using the code below:

JOINKEYS FILE=F1,FIELDS=(21,7,A)
JOINKEYS FILE=F2,FIELDS=(34,13,A)
JOIN UNPAIRED
REFORMAT FIELDS=(F2:1,4223,F1:1,133)
SORT FIELDS=COPY
OUTFIL FILES=03,INCLUDE=(5,1,CH,EQ,C' '),BUILD=4224,133)
OUTFIL FILES=02,INCLUDE=(4228,1,CH,EQ,C' '),BUILD=(1,4223)
OUTFIL FILES=01,SAVE,BUILD=(1,4223)


The good result is not reached.

Could someone help me?
Thanks in advance.

Posted: Fri Apr 27, 2012 1:32 am
by Frank Yaeger
Which sort product are you using - DFSORT (ICE messages) or Syncsort (WER messages)?

Posted: Fri Apr 27, 2012 6:56 pm
by juares castro
Hi!
I'm using SYNCSORT.
Thanks.

Posted: Fri Apr 27, 2012 8:50 pm
by DikDude
You cannot compare packed-decimal against zoned-decimal using the Alpha data type.

You need to compare these as numerics.