SAS中文论坛

标题: 求解 SAS 函数 [打印本页]

作者: shiyiming    时间: 2012-8-18 23:19
标题: 求解 SAS 函数
需求是这样的,想找出观察值中包含某一个关键字,然后显示该记录。
例如:
Update all team reports and schedule properly through working with developer and factory.

Update all team reports  properly through working with developer and factory.

找出观测值中包含 and  的观测值。

结果:
Update all team reports and schedule properly through working with developer and factory.

也就是类似oracle 的like 功能。
不知道SAS是否有这样函数是否可以实现。

谢谢!
作者: shiyiming    时间: 2012-8-19 03:18
标题: Re: 求解 SAS 函数
方式有很多,以下是其中之一:
[code:3pxes3nz]
data ads;
length a $ 80;
input a & $;
re=count(a,"and");
cards;
Update all team reports properly through working with developer and factory.
;
[/code:3pxes3nz]
作者: shiyiming    时间: 2012-8-21 10:16
标题: Re: 求解 SAS 函数
where statement里可以用like. where ... like "%and%". 也可以用 where ... contains "and"
作者: shiyiming    时间: 2012-9-6 19:42
标题: Re: 求解 SAS 函数
if only 'and' but not 'sand', COUNTW() function works. jingju
作者: shiyiming    时间: 2012-10-15 21:01
标题: Re: 求解 SAS 函数
contain函数




欢迎光临 SAS中文论坛 (http://mysas.net/forum/) Powered by Discuz! X3.2