Page 1 of 1

JOINKEYS for two different file layout compare

PostPosted: Tue Jul 22, 2014 6:48 pm
by Ramsee
Hi ,
I am comparing two files File with LRECL = 154 File2 with LRECL =19
Keys in the File1 = 4,9 Keys in File2 = 1,9

I used follwoing SORTCARD for the task but the output is not as expected, please suggest me or correct me with your inputs.
OPTION COPY                                     
JOINKEYS FILES=F1,FIELDS=(4,9,A)                 
JOINKEYS FILES=F2,FIELDS=(1,9,A)                 
JOIN UNPAIRED                                   
REFORMAT FIELDS=(F1:01,154,F2:01,19)             
OUTFIL FNAMES=MTCH01,                           
  INCLUDE=(1,1,CH,NE,C' ',AND,155,1,CH,NE,C' '),
  BUILD=(1,154)                                 
OUTFIL FNAMES=UNMTCH01,                         
  INCLUDE=(1,1,CH,NE,C' ',AND,155,1,CH,EQ,C' '),
  BUILD=(1,154)                                 
OUTFIL FNAMES=UNMTCH02,                         
  INCLUDE=(1,1,CH,EQ,C' ',AND,155,1,CH,NE,C' '),
  BUILD=(155,19)                                 

Re: JOINKEYS for two different file layout compare

PostPosted: Tue Jul 22, 2014 7:28 pm
by Healy
I am not an Expert(total Noob :) ) and someone would have to verify this solution but i think the problem may be in the INCLUDE statement

For comparison of matched and unmatched , try the following in place of the INCLUDE COND

INCLUDE=(1,154,CH,NE,C' ',AND,155,19,CH,NE,C' '),
 BUILD=(1,154)


INCLUDE=(1,154,CH,NE,C' ',AND,155,19,CH,EQ,C' '),
 BUILD=(1,154)


INCLUDE=(1,154,CH,EQ,C' ',AND,155,19,CH,NE,C' ')
BUILD=(155,19)



let me know if it works !

Re: JOINKEYS for two different file layout compare

PostPosted: Tue Jul 22, 2014 8:16 pm
by BillyBoyo
Healy,

Nice to see you trying. That may well work. But before fixing something, we need to first know what is wrong...

Ramsee,

You didn't tell us what is wrong.

Can position one of your 154-byte record genuinely contain space? You can specify FILL= on the REFORMAT to give an uncommon value to the "empty" part of the REFORMAT record. You need to find a byte to test which can't genuinely have the value you are testing for. However, something else could be wrong. So what is it?

Re: JOINKEYS for two different file layout compare

PostPosted: Wed Jul 23, 2014 3:25 pm
by Ramsee
hi,

Thanks for help!!!
The SORTCARD given by Healy is working perfect!!
Thanks a lot BillyBoyo for giving me a new dimension to think about the records contaiing SPACES, as you are perfect that the INPUT File contained SPACES as well.

Feeling great that i am learning a lot from you all.

Thanks,
Ramsee