Why does the PROC PRINT call with the following WHERE clause produce no observations? PROC PRINT DATA=work.salaries; WHERE salary GT 20000; RUN;

Master the SAS Base Programming Certification Exam with our comprehensive study tool. Utilize flashcards and multiple choice questions with detailed explanations. Gear up for success on your exam!

The statement that the WHERE clause in the PROC PRINT call produces no observations is correct because WHERE statements do not automatically convert data types. If the variable "salary" is stored as a character type instead of a numeric type, the condition "salary GT 20000" will not be able to evaluate correctly. Since the comparison requires both operands to be of compatible types, having a character variable and a numeric constant leads to the WHERE clause being unable to process the comparison, resulting in zero observations being printed.

The other options encompass misunderstandings about SAS functionality. The symbol "GT" is a recognized operator within the SAS language, so the statement about it being invalid is not accurate. Similarly, the WHERE clause does not require the literal value to be formatted with a comma, as SAS can handle numeric comparisons without any formatting unless specifically required for output display. Thus, the issue here is rooted in the type incompatibility that arises when trying to compare character data with a numeric value.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy