|
|
沙发

楼主 |
发表于 2010-3-25 08:56:09
|
只看该作者
Re: 求教:如何用sql做动态模糊查询?
一定要求是SQL吗?用宏可以不?小宏一个,仅供参考。
[code:gwd2kaer]%macro indexkw(input=,std=,output=);
data _NULL_;
set &std end=eof;
call symput('KW'||trim(left(put(_N_,best.))),trim(left(KeyWrd)));
call symput('KWS'||trim(left(put(_N_,best.))),trim(left(put(_N_,best.))));
if eof then call symput('KWNO',trim(left(put(_N_,best.))));
run;
data &output;
set &input;
%do i=1 %to &KWNO;
if index(lowcase(String),lowcase("&&KW&i")) gt 0 then KWSEQ&i=input("&&KWS&i",best.);
%end;
run;
%mend indexkw;
%indexkw(input=F,std=G,output=temp);
[/code:gwd2kaer] |
|