data work.passengers; if origpassengers=. then origpassengers = 100; transpassengers = 100; origpassengers = .; nonpaying = 10; totalpassengers = sum(origpassengers ,transpassengers); run; Which one of the following is the value of the TOTALPASSENGERS variable in the output dataset?

  1. 100

  2. 110

  3. 200

  4. missing


Correct Option: B

AI Explanation

To determine the value of the TOTALPASSENGERS variable in the output dataset, let's go through the code step by step:

  1. data work.passengers; - This line creates a new dataset named "passengers" in the "work" library.

  2. if origpassengers=. then origpassengers = 100; - This line checks if the variable "origpassengers" is missing. If it is missing, it assigns a value of 100 to it.

  3. transpassengers = 100; - This line assigns a value of 100 to the variable "transpassengers".

  4. origpassengers = .; - This line assigns a missing value to the variable "origpassengers", overwriting the previous value of 100.

  5. nonpaying = 10; - This line assigns a value of 10 to the variable "nonpaying".

  6. totalpassengers = sum(origpassengers, transpassengers); - This line calculates the sum of the variables "origpassengers" and "transpassengers" and assigns the result to the variable "totalpassengers".

  7. run; - This line executes the data step and creates the output dataset.

Since the value of "origpassengers" is missing and the value of "transpassengers" is 100, the sum of these two variables will be 100. Therefore, the value of the TOTALPASSENGERS variable in the output dataset will be 100.

The correct answer is option A) 100.

Find more quizzes: