楼主: usrich
3947 2

IF-THEN/ELSE vs SELECT [推广有奖]

  • 1关注
  • 0粉丝

高中生

62%

还不是VIP/贵宾

-

威望
0
论坛币
22 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
280 点
帖子
34
精华
0
在线时间
21 小时
注册时间
2006-11-28
最后登录
2015-6-7

楼主
usrich 发表于 2011-4-14 04:24:11 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

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.
二维码

扫码加我 拉你入群

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

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

关键词:Select Elect Then else ect Select else

沙发
爱萌 发表于 2011-4-14 09:07:01
太大的选择需要输入很多条件,浪费时间也浪费运行时间
最恨对我说谎或欺骗我的人

藤椅
dkzn27 发表于 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.

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-2 03:22