SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 800|回复: 1
打印 上一主题 下一主题

请问where b=*'smi'的筛选规则,谢谢

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2008-10-27 17:25:34 | 只看该作者

请问where b=*'smi'的筛选规则,谢谢

data table1;
    infile datalines;
    input a b $;
datalines;
2000 smitha
3000 asmith
200 smith
1000 smita
4000 asmithb
;
run;


data table2;
    set table1;
        where b=*'smi';
run;
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
沙发
 楼主| 发表于 2008-10-27 18:28:53 | 只看该作者

Re: 请问where b=*'smi'的筛选规则,谢谢

Sounds-like Operator
The sounds-like ( =*) operator selects observations that contain a spelling variation of a specified word or words. The operator uses the Soundex algorithm to compare the variable value and the operand. For more information, see the SOUNDEX function in SAS Language Reference: Dictionary.

Note:   Note that the SOUNDEX algorithm is English-biased, and is less useful for languages other than English.  

Although the sounds-like operator is useful, it does not always select all possible values. For example, consider that you want to select observations from the following list of names that sound like Smith:

Schmitt

Smith

Smithson

Smitt

Smythe


The following WHERE expression selects all the names from this list except Schmitt and Smithson:

where lastname=* 'Smith';

You can combine the NOT logical operator with the sounds-like operator to select values that do not contain a spelling variation of a specified word or words, such as:

where lastname not =* 'Smith';

Note:   The sounds-like operator cannot be optimized with an index.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2026-2-5 03:23 , Processed in 0.066233 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表