Exam A00-211 All QuestionsBrowse all questions from this exam
Question 18

The following SAS program is submitted, creating the SAS data set ONE: data one; infile file specification; input num chars$; run;

ONE -

NUM CHAR -

------- ---------

1 23

3 23

1 77

The following SAS program is submitted:

proc print data = one;

where char = 23;

run;

What is output?

    Correct Answer: B

    The WHERE statement is used to subset data based on a condition. In this case, we are checking where the character variable CHAR is equal to 23. According to the data set ONE, the value '23' appears twice in the CHAR variable corresponding to NUM values 1 and 3. Therefore, the output will include these observations. Since CHAR is a character variable (indicated by the $ in the input statement), the condition 'where char = 23' implicitly converts the numeric comparison to a character comparison. Thus, the correct output is NUM CHAR 1 23 and 3 23.

Discussion
mhminkovOption: D

if we assume that the missing quotations marks are intentional, then given answer D is correct, .. message in Log: "ERROR: WHERE clause operator requires compatible variables."

KleinstoneOption: B

the answer seems incorrect. The proper one is B.