joinkey with different formats of key
Posted: Thu Apr 26, 2012 11:39 pm
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.
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.