A00-211 Exam QuestionsBrowse all questions from this exam

A00-211 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?

Show Answer
Correct Answer: BD

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

2 comments
Sign in to comment
KleinstoneOption: B
Dec 20, 2020

the answer seems incorrect. The proper one is B.

mhminkovOption: D
Jun 5, 2021

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."