标题: how to get the part before delimiter(\) [打印本页] 作者: shiyiming 时间: 2013-5-15 04:18 标题: how to get the part before delimiter(\) data a;
input x $20.;
cards;
123/abc
nba-cba009
1-m-409_f/rt_87
_nnt@/.com
....
;
run;
I just need the part before '/', such as
123
nba-cba009
1-m-409_f
_nnt@
....
I tried prxchange(), but looks hard to express '/' which the exact perl meta symbol '/'.
So anyone can help?
Thx million!作者: shiyiming 时间: 2013-5-15 21:23 标题: Re: how to get the part before delimiter(\) data a;
input x $20.;
cards;
123/abc
nba-cba009
1-m-409_f/rt_87
_nnt@/.com
;
run;
data b(drop=rc);
set a;
rc=find(x, '/');
if rc>0 then y=substr(x,1,rc-1);
else y=x;
run;作者: shiyiming 时间: 2013-5-18 00:01 标题: Re: how to get the part before delimiter(\) To match this special character, you must precede it with a backslash character (\).