SAS Base Programming for SAS 9 — Question 6
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?
Answer options
- A. NUM CHAR 1 77
- B. NUM CHAR 1 23 3 23
- C. NUM CHAR 1 23 3 23 1 77
- D. No output is generated.
Correct answer: D
Explanation
The WHERE clause filters the dataset for records where CHAR equals 23. Since the CHAR values are 23 and 77, but only 23 is specified, it will return the rows that match this condition, which in this case results in no output because the values are treated as distinct observations. Therefore, option D is correct as there is no matching data after filtering.