@Pandu2 wrote:
Could your code work if table T2 has this kinda data, if it doesn't may I know how to make it work.
data T2;
input ItemNo :$10. (ItemC1 - ItemC5) (:$8.);
datalines;
A101 MRF:123 . . Ceat:789 .
A100 MRF:098 . Ceat:453 . .
B01 IRP:126 . . . CRO:670
B0101 IRP:309 CRO:012 . . .
;
Same rules and same concept.
I suspect you are asking to match on the part before the colon instead of the full string? If so that will require changing how you match. For example you could not use IN or WHICHC() to match since those are exact matches. You could perhaps use SCAN() to pull out the part before the colon.
whichc(t1.itemc1,scan(t2.itemc1,1,':'),scan(t2.itemc2,1,':'), ...