The PROC MEANS statement is used to compute descriptive statistics of data in SAS. Option A is the
correct code to produce the report shown in the first image because of the following reasons:
data=sashelp.shoes specifies the dataset on which the procedure is to be performed.
sum mean specifies that the summary statistics should include the sum and mean of the variables.
var Sales; specifies that the variable Sales is the analysis variable for which the summary statistics are
to be computed.
class Product; specifies that the procedure should classify results by unique values of the Product
variable. This will produce separate statistics for each type of product, which aligns with the structure
of the report provided in the image.
Options B, C, and D are incorrect for the following reasons:
B uses group instead of class, and group is not a valid statement in the context of PROC MEANS. Also,
var Sale; is incorrect as the variable name is Sales.
C includes nobe; which is not a valid SAS option and seems to be a typo. The by statement is used for
sorting data, not for classifying groups as class does.
D incorrectly uses sum Salad; and mean Sales; as separate statements and has an invalid use of by
product; which is not needed here.
Reference:
SAS 9.4 documentation for the PROC MEANS statement: SAS Help Center: PROC MEANS