I would agree that the answer is A. The BY statement requires that the input dataset is sorted or grouped by the group identifier(s) or indexed appropriately, though.
B: There is no (documented) GROUPBY statement or option in PROC MEANS.
C: The CLASS statement has additional memory requirements (see section "Computational Resources" in Concepts: MEANS Procedure). These are the price for being able to deal with unsorted, non-indexed data.
😧 Multiple WHERE statements within the same PROC MEANS step do not make sense (as only the last WHERE statement would take effect). Multiple PROC MEANS steps with different WHERE statements, apart from being obviously inefficient, would first require memory to determine the WHERE conditions.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.