To determine the value of the totalpassengers
variable in the output data set, let's go through each step of the SAS code provided:
data work.passengers;
: This line of code creates a new SAS data set named passengers
in the work
library.
if origpassengers=. then origpassengers = 100;
: This line of code checks if the origpassengers
variable is missing (.
). If it is missing, it assigns a value of 100 to origpassengers
. However, since origpassengers
is not explicitly defined in the code, it is assumed to be missing.
transpassengers=100;
: This line of code assigns a value of 100 to the transpassengers
variable.
origpassengers=.;
: This line of code assigns a missing value to the origpassengers
variable. This line is executed after step 2, so the value assigned in step 2 is overwritten by the missing value.
nonpaying=10;
: This line of code assigns a value of 10 to the nonpaying
variable.
totalpassengers = origpassengers + Transpassengers;
: This line of code calculates the sum of the origpassengers
and transpassengers
variables and assigns the result to the totalpassengers
variable. Since both origpassengers
and transpassengers
are missing, the sum will also be missing.
run;
: This line of code signals the end of the data step.
Therefore, the value of the totalpassengers
variable in the output data set is missing (Option D).