由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 请教几个ADV问题
相关主题
About ID in sasSAS 问题
SAS adv question.请大家帮忙看看One question about data step in sas
请问两道sas adv的题..another sas question
ADV 12月真题另一问问大家一道SAS认证题
请教 2 道SAS Adv 真题哭死,用SAS作logistic regression的coefficients为何全部和proc reg得到的相反??
问道SAS ADV真题SAS的小问题
请教SAS adv 题库一道题如何将mmddyyW. 换成mmyyW. 格式? format Var mmyyW.好像不能用在data set 中。谢谢
问一个不产生SAS Log的命令问一个简单的SAS问题,多谢
相关话题的讨论汇总
话题: index话题: sas话题: code话题: var话题: question
进入Statistics版参与讨论
1 (共1页)
o****n
发帖数: 281
1
遇到了几个SAS ADV问题,希望大家帮忙看下,谢谢了!
question 1:
The SAS data set WORK.TEST has an index
on the variable Id and the following SAS
program is submitted.
data WORK.TEST;
set WORK.TEST(
keep=Id Var_1 Var_2
rename=(Id=Id_Code));
Total=sum(Var_1, Var_2);
run;
请问这里的indexed variable Id是否在重命名之后,其index就被删除了?有以下几个
选项:
A.
The index on Id is deleted.
B.
The index on Id is updated as an index on Id_Code.
C.
The index on Id is deleted and an index on Id_Code is created.
D.
The index on Id is recreated as an index on Id_Code.
QUESTION 2:
For match-merge BY variables, they should have the same ...
A. name and type
B. name
C. name and length
D. name and type and length
d******9
发帖数: 404
2
First question is a very good question. I think the answer is A:
A. The index on Id is deleted.
I run the codes in SAS, and found that the index on ID is really gone.
o****n
发帖数: 281
3

Thank you so much dido2009! I think it should be A.
How about question 2? I think they should have the same name and type, but
not sure...
Thanks!

【在 d******9 的大作中提到】
: First question is a very good question. I think the answer is A:
: A. The index on Id is deleted.
: I run the codes in SAS, and found that the index on ID is really gone.

d******9
发帖数: 404
4
Question 2, they should have same name and type. You are right.
However, if they have different lengths, SAS may give you a warning in LOG,
although it will execute without errors.
For example, if you run below codes:
data T1;
length D $5;
input D staff;
cards;
AAA 36
BBB 89
;
run;
data T2;
length D $10;
input D staff;
cards;
AAA 780
BBB 512
;
run;
data T3;
merge T1 T2;
by D;
run;
You will have this WARNING
WARNING: Multiple lengths were specified for the BY variable D by input data
sets. This may cause unexpected results.
However if you change the merge order:
17 data T3;
18 merge T2 T1;
19 by D;
20 run;
Then no warning in LOG. Because the variable length is determined by first
occurrence in SAS !
o****n
发帖数: 281
5

LOG,
I appreciate your help, dido2009! That is really helpful :)

【在 d******9 的大作中提到】
: Question 2, they should have same name and type. You are right.
: However, if they have different lengths, SAS may give you a warning in LOG,
: although it will execute without errors.
: For example, if you run below codes:
: data T1;
: length D $5;
: input D staff;
: cards;
: AAA 36
: BBB 89

1 (共1页)
进入Statistics版参与讨论
相关主题
问一个简单的SAS问题,多谢请教 2 道SAS Adv 真题
how to combine characters and numric variable in "where" clause by SAS?urgent!问道SAS ADV真题
弱问SAS:如何找出两个data sets中missing的obs请教SAS adv 题库一道题
请教SAS advanced 真题中最后一道题问一个不产生SAS Log的命令
About ID in sasSAS 问题
SAS adv question.请大家帮忙看看One question about data step in sas
请问两道sas adv的题..another sas question
ADV 12月真题另一问问大家一道SAS认证题
相关话题的讨论汇总
话题: index话题: sas话题: code话题: var话题: question