楼主: crackman
1828 0

[原创博文] 跟crakman做sas base认证试题(42) [推广有奖]

已卖:401份资源

院士

83%

还不是VIP/贵宾

-

威望
6
论坛币
91928 个
通用积分
23.5045
学术水平
424 点
热心指数
505 点
信用等级
256 点
经验
112978 点
帖子
2940
精华
0
在线时间
2532 小时
注册时间
2007-4-26
最后登录
2025-6-25

初级热心勋章 中级热心勋章 初级学术勋章 初级信用勋章

楼主
crackman 发表于 2010-11-12 21:10:52 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
42.The following SAS program is submitted:

data WORK.ONE;
     Text='Australia, US, Denmark';
     Pos=find(Text,'US','i',5);
run;

What value will SAS assign to Pos?

     A. 0
     B. 1
     C. 2
     D. 12

Answer: D
本文属于博客:http://www.crackman.net/版权归作者所有,欢迎转载!如有转载,请务必注明出处!未经本文作者同意不得用于商业应用。
本题考察的是SAS中FIND函数的应用。
POS=FIND(Text,'US','i',5)解释为:
从Australia, US, Denmark 字符串的第五个字符开始,忽略字符串中大小写,寻找字符串US在源字符串中的起始位置,并返回起始位置的数字给POS。
几个问题值得思考,第一个是如果没有'i'这个参数,结果会怎么样?如果把5改成1,那么结果又如何?
看看SAS官网网站的解释:
Syntax
FIND(string,substring<,modifiers><,startpos>)
FIND(string,substring<,startpos><,modifiers>)

Searches for a specific substring of characters within a character string.
Arguments
string
specifies a character constant, variable, or expression that will be searched for substrings.

Tip: Enclose a literal string of characters in quotation marks.
substring
is a character constant, variable, or expression that specifies the substring of characters to search for in string.

Tip: Enclose a literal string of characters in quotation marks.
modifiers
is a character constant, variable, or expression that specifies one or more modifiers. The following modifiers can be in uppercase or lowercase:

i ignores character case during the search. If this modifier is not specified, FIND only searches for character substrings with the same case as the characters in substring.

t trims trailing blanks from string and substring.

Note:   If you want to remove trailing blanks from only one character argument instead of both (or all) character arguments, use the TRIM function instead of the FIND function with the T modifier.

Tip: If modifier is a constant, enclose it in quotation marks. Specify multiple constants in a single set of quotation marks. Modifier can also be expressed as a variable or an expression.

startpos
is a numeric constant, variable, or expression with an integer value that specifies the position at which the search should start and the direction of the search.


二维码

扫码加我 拉你入群

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

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

关键词:SAS base Base CRA Man Characters 题库 SAS 认证 Base crackman

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-27 05:31