全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3897 2
2011-04-14

When do IF-THEN/ELSE statements in a SAS DATA step always use fewer CPU resources than a SELECT statement?

(A) when there is a small selection of uniformly distributed values

(B) when there is a small selection of randomly distributed values

(C) when there is a large selection of uniformly distributed values

(D) when there is a large selection of randomly distributed values

The answer is (A). But why? Any thoughts? Thanks a lot.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2011-4-14 09:07:01
太大的选择需要输入很多条件,浪费时间也浪费运行时间
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-11-1 09:17:55
原作者年代有点久远,我在备考时候也遇到了这个问题,然后就google了一下。以后还有人需要问答,大家看一下吧,可靠答案。
貌似意思就是如果是那种0/1逻辑条件的情况下,SELECT 比IF更有效。
When you have a long series of mutually exclusive conditions, using a SELECT group is more efficient than using a series of IF-THEN statements because CPU time is reduced. Large numbers of conditions make a SELECT group more efficient than IF-THEN/ELSE statements because CPU time is reduced. SELECT groups also make the program easier to read and debug.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群