楼主: bbcc3675
4420 6

求助 问几道ADV的题,明天就考试了 [推广有奖]

  • 0关注
  • 0粉丝

小学生

71%

还不是VIP/贵宾

-

威望
0
论坛币
80 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
126 点
帖子
11
精华
0
在线时间
0 小时
注册时间
2006-11-19
最后登录
2008-9-29

楼主
bbcc3675 发表于 2007-7-10 03:59:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
谢谢大家了,明天就考了.

1.这题我一直不太明白什么时候用INDEX?为什么后面2个WHERE的不可以

The SAS data set SASDATA.SALES has a simple index on the variable DATE and a variable
named REVENUE with no index.
In which one of the following SAS programs is the DATE index considered for use?
proc print data = sasdata.sales;
by date;
run;
proc print data = sasdata.sales;
where month(date) = 3;
run;
data march;
set sasdata.sales;
if '01mar2002'd < date < '31mar2002'd;
run;
data march;
set sasdata.sales;
where date < '31mar2002'd or revenue > 50000;
run;
correct_answer = "A"


2.这题的大小写有什么区别呢


The following SAS code is submitted:

%macro houses(dsn = houses,sub = RANCH);

data &dsn;

set sasuser.houses; if style = "&sub";

run;

%mend;

%houses(sub = SPLIT)

%houses(dsn = ranch)

%houses(sub = TWOSTORY)

Which one of the following is the value of the automatic macro variable SYSLAST?



A. work.ranch

B. work.houses

C. WORK.RANCH

D. WORK.HOUSES



Answer: D



3为什么是C不是D

Given the following SAS statement:

%let idcode = Prod567;

Which one of the following statements stores the value 567 in the macro variable CODENUM?



A. %let codenum = substr(&idcode,length(&idcode)-2);

B. %let codenum = substr(&idcode,length(&idcode)-3);

C. %let codenum = %substr(&idcode,%length(&idcode)-2);

D. %let codenum = %substr(&idcode,%length(&idcode)-3);
二维码

扫码加我 拉你入群

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

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

关键词:Statements following statement Automatic Variable 求助 考试 adv

沙发
cxu07 发表于 2007-7-10 09:10:00

Questions 1:

SAS determine when to use index , it has these definition:

Determining Whether SAS Is Using an Index

It is not always possible or more efficient for SAS to use an existing index to access specific observations directly. An index is not used

  • with a subsetting IF statement in a DATA step
  • with particular WHERE expressions
  • if SAS determines it is more efficient to read the data sequentially.

So the both where statements reads most of the observations of datasets, using index is not efficient. So A is the better answer.

Q2:

Not quiet sure, but when you try to find the match name to automatic variables, you always need the exactly upper case, lower case does not match. That’s what I’m understanding, let you know if finding better answer.

Q3:

If you know how to use substr() function, you won’t think D is correct answer.

%substr(&idcode,%length(&idcode)-2),

let’s see:

&idcode resolves to Prod567,

length(&idcode) = length(Prod567) = 7, so far, you ok?

So 7-2 = 5;

Next, we need to know how to use substr() function: Substr(var, start_postion).

Then %substr(&idcode,%length(&idcode)-2) = %substr(Prod567, 5) = 567.

If answer is D, so length(&idcode)-3 = 7 – 3 =4;

%substr(Prod567, 4) = d567;

Hope this helps and will be glade to hear your news after you test!

[此贴子已经被作者于2007-7-10 9:33:12编辑过]

藤椅
mxqy 发表于 2007-7-10 10:52:00

回复:(bbcc3675)求助 问几道ADV的题,明天就考试了

Q2: all values of SAS automatic variables are in capital letter. They just want to test if you know that.

板凳
WOAISAS 发表于 2007-7-10 12:40:00

Q1: why the two where statement did not work:

* SAS does not use and index to process a WHERE condition that contains any function other than TRIM or SUBSTR.

* conditions joined by the operator OR do not reference the same variable

good luck!

报纸
mxqy 发表于 2007-7-10 13:08:00
I will take ADV exam next week. Pls share your experience with us. Good luck!

地板
bbcc3675 发表于 2007-7-10 22:31:00

Thanks a million.You guys are so nice.~~~

I'm going to drive to the test centre.........................

just 3hours left..

7
hotlip 发表于 2008-6-26 06:22:00

在automatic macro variable syslast 中,dataset名称总是以LIB.DSN形式出现的,如WORK.TEST.如果SAS session 尚未生成dataset,syslast 的值好像是NULL

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

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