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编辑过]