[pre]
data store1;
input id product $ type $;
datalines;
1 000112 refferal
2 000112 approval
3 000112 ship
4 000113 ship
;
run;
data store2;
input product $ productname $;
datalines;
112 xyz
113 abc
115 def
A15 def
;
run;
data store11;
set store1;
product=substr(product,verify(product,'0'));
run;
proc sort data=store11;
by product;
run;
proc sort data=store2;
by product;
DATA store3;
MERGE store11(in=one) store2;
BY product;
if one;
RUN;
[/pre]
Or
[pre]
data store1;
input id product $ type $;
datalines;
1 000112 refferal
2 000112 approval
3 000112 ship
4 000113 ship
;
run;
data store2;
input product $ productname $;
datalines;
112 xyz
113 abc
115 def
A15 def
;
run;
proc sql;
create table want as
select a.* ,b.productname
from store1 as a left join store2 as b on a.product contains strip(b.product)
;
quit;
[/pre]
Ksharp
Message was edited by: Ksharp