DATA file2;
length term term1 $28.;
SET BADWORD0;
TERM = '%'||TRIM(UPCASE(TERM1))||'%';
RUN;
proc sql;
select "(name like'" || trim(term) || "')" into :macrovar separated by " or " from file2;
create table matches as select * from file1 where ¯ovar);
quit;
这个程序能找出在name里有term字符串。但是想要在match table 里也包括term一个column.又写了一个程序如下:
proc sql;
create table matches1 as
select file1.* , file2.term
from file1, file2
where file1.name like file2.term
order by 2;
quit;
但是2个程序的查找出的结果不一样, matches1 要比matches 少好些
请教问题出在哪里?怎么解决这个match的问题。 先谢



雷达卡



京公网安备 11010802022788号







