楼主: freedom1225jjy
3296 2

sas base programming 几道题求助! [推广有奖]

  • 0关注
  • 1粉丝

已卖:845份资源

初中生

9%

还不是VIP/贵宾

-

威望
0
论坛币
4569 个
通用积分
0.1200
学术水平
3 点
热心指数
4 点
信用等级
0 点
经验
364 点
帖子
11
精华
0
在线时间
6 小时
注册时间
2013-1-7
最后登录
2016-5-4

楼主
freedom1225jjy 发表于 2013-1-8 18:47:06 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
1.A realtor has two customers. One customer wants to view a list of homes selling for
less than $60,000. The other customer wants to view a list of homes selling for
greater than $100,000.
Assuming the PRICE variable is numeric, which one of the following PRINT
procedure steps will select all desired observations?
A. proc print data = sasuser.houses;
where price lt 60000;
where price gt 100000;
run;
B. proc print data = sasuser.houses;
where price lt 60000 or price gt 100000;
run;
C. proc print data = sasuser.houses;
where price lt 60000 and price gt 100000;
run;
D. proc print data = sasuser.houses;
where price lt 60000 or where price gt 100000;
run;

答案是B 但是我认为A是不是也可以?

2.

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 ofthe variable FIRST in the output data
set?
A. 1
B. 6
C. 15
D. 200
Answer: D

为什麽答案是D?

3.
The following SAS program is submitted:
data work.test;
Title = 'A Tale of two Cities, Charles j.Dickens';
Word = scan(title,3,' ,');
run;
Which one of the following is the value of the variable WORD in the output data
set?
A. T
B. of
C. Dickens
D. ' ' (missing character value)
Answer: B


为什麽答案是B?

4.
The following SAS DATA step is submitted:
data work.accountting;
set work.department;
length jobcode$ 12;
run;
The WORK.DEPARTMENT SAS data set contains a character variable named
JOBCODE with a length of 5.
Which one of the following is the length of the variable JOBCODE in the output
data set?
A. 5
B. 8
C. 12
D. The length can not be determined as the program fails to execute due to errors.
Answer: A

为什麽答案是A不是C?

5.
The following SAS program is submitted:
data work.staff;
JobCategory= 'FA';
JobLevel= '1';
jobCategory= JobCategory || JobLevel;
run;
Which one of the following is the value of the variable JOBCATEGORY in the
output data set?
A. FA
B. FA1
C. FA 1
D. ' ' (missing character value)
Answer: A
为什麽答案是A不是B或者C?原理是什麽?
6.A SAS PRINT procedure output of the WORK.LEVELS data set is listed below:
Obsname level
1 Frank 1
2 Joan 2
3 Sui 2
4 Jose 3
5 Burt 4
6 Kelly .
7 Juan 1
The following SAS program is submitted:
data work . expertise;
set work. levels;
if level = . then
expertise = 'Unknown';
else if level = 1 then
expertise = 'Low';
else if level = 2 or 3 then
expertise =' Medium';
else
expertise = 'High';
run;
Which of the following values does the variable EXPERTISE contain?
A. Low, Medium, and High only
B. Low, Medium, and Unknown only
C. Low, Medium, High, and Unknown only
D. Low, Medium, High, Unknown, and ' ' (missing character value)

为什麽答案是B 不是C?

谢谢!
二维码

扫码加我 拉你入群

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

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

关键词:Programming SAS base Program gram Base sas base programming

沙发
yzsxdlcc 发表于 2013-1-9 11:08:55
1、
A. proc print data = sasuser.houses;
where price lt 60000;
where price gt 100000;
run;

只有where price gt 100000生效(只有放在后面的where生效)

2、如果不用length设置first的长度,scan函数为目标变量设定缺省长度为200

3、这题是不是答案出错了,我用sas代码测试了,答案选D

4、数据集.DEPARTMENT中的JOBCODE长度为5. 且set work.department;在length jobcode$ 12;语句之前,sas是逐句编译的,则前面的代码决定了长度

5、同4题,JobCategory= 'FA'; 这里jobCategory已经被决定长度为2

6、else if level = 2 or 3 then expertise =' Medium';编译的时候,会自动将这个式子or 3自动判断为 TRUE.所以,不会出来High

----------------------------
从骨感走向丰满

文库

藤椅
husx19 发表于 2013-1-10 10:22:24
thank u very much
年轻是我们最大的资本,加油!

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

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