97.0k views
1 vote
Which statement is true based on the given program?

data baseball2;
set sashelp.baseball;
BatAvg=CrHits/CrAtBat;
label BatAvg="Batting Average";
run;

proc print data=baseball2;
var Name Team BatAvg;
run;

proc means data=baseball2;
var BatAvg;
class Team;
run;

a. The column BatAvg will have a permanent label in the sashelp.baseball data set.
b. The label for BatAvg will appear in the PROC PRINT report.
c. The label for BatAvg will appear in the PROC MEANS report.
d. The label for BatAvg will appear in both reports.

User Szydzik
by
7.5k points

1 Answer

4 votes

Final answer:

The permanent label 'Batting Average' for the BatAvg variable will appear in the PROC PRINT report but not in the PROC MEANS report in SAS unless the LABEL option is specified in PROC MEANS.

Step-by-step explanation:

The correct answer is option b. The label for BatAvg will appear in the PROC PRINT report. When the label statement is used in the DATA step in SAS, it assigns a permanent label to the variable that will be used in subsequent procedures that display the data, such as PROC PRINT.

However, PROC MEANS uses the variable names by default in its output and does not show labels unless the LABEL option is explicitly specified. Therefore, the label "Batting Average" will be seen in the PROC PRINT output beside the BatAvg variable but not in the PROC MEANS output unless the LABEL option is added to the PROC MEANS procedure.

User Alexander Belokon
by
8.0k points