标题: SAS Base 2题? [打印本页] 作者: shiyiming 时间: 2009-7-15 01:07 标题: SAS Base 2题? 73. The following SAS program is submitted:
data work.test;
First = 'Ipswich, England';
City_Country = substr(First,1,7)!!', '!!'England';
run;
Which one of the following is the length of the variable CITY_COUNTRY in the
output data set?
A. 6
B. 7
C. 17
D. 25
Answer: D
76. The following SAS program is submitted:
data work.test;
Author = 'Agatha Christie';
First = substr(scan(author,1,' ,'),1,1);
run;
Which one of the following is the length of the variable FIRST in the output
data set?
A. 1
B. 6
C. 15
D. 200
Answer: D
可以问一下解答的思路吗?作者: Qiong 时间: 2009-7-15 15:33 标题: Re: SAS Base 2题? 你run一下看看,就会发现
substr(First,1,7)跟first的长度是一样的。
scan(First,1,',')的结果是默认长度200的。作者: shiyiming 时间: 2009-7-20 09:27 标题: Re: SAS Base 2题? 请问substr(First,1,7)!!', '!!'England'
最后输出的字符串是什么?