A00-212 Exam QuestionsBrowse all questions from this exam

A00-212 Exam - Question 4


Given the following SAS data set ONE:

ONE -

LEVEL AGE -

1 10

2 20

3 20

2 10

1 10

2 30

3 10

2 20

3 30

1 10

The following SAS program is submitted:

proc sql;

select level, max(age) as MAX

from one

group by level

having max(age) > (select avg(age) from one);

quit;

Which one of the following reports is generated?

Show Answer
Correct Answer: B,D

The given SAS program uses the PROC SQL procedure to select the highest age (MAX) for each level from data set ONE, then filters those levels where this maximum age is greater than the overall average age of the dataset. The overall average age in this dataset [(10+20+20+10+10+30+10+20+30+10)/10 = 17]. For LEVEL 2, the maximum age is 30, and for LEVEL 3, the maximum age is also 30. Both of these values are greater than the average age of 17. Therefore, the correct report that is generated is the one listing LEVEL 2 with MAX 30 and LEVEL 3 with MAX 30.

Discussion

1 comment
Sign in to comment
mhminkovOption: D
Aug 22, 2021

LEVEL MAX 2 30 3 30