By admin | September 18, 2009

SAS Certified Base Programmer 123 Questions (61)

The following SAS program is submitted:

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 data set?

A. 100
B. 110
C. 200
D. . (missing numeric value)

4 comments | Add One

  1. admin - 09/18/2009 at 4:17 pm

    A

  2. Himanshu - 06/14/2012 at 3:02 pm

    how answer is A? could you please clarify

  3. Monica - 01/21/2013 at 2:05 pm

    above answer is wrong answer should be D missing value .

  4. Fleevi - 07/9/2014 at 6:21 pm

    answer is A
    add the statement
    put TotalPassengers=;
    to convince yourself. The sum() function behaves differently than explicit arithmetic statements. Sum() would treat any missing value as if they are zeros.

Leave a Comment

Leave a Reply

Your email address will not be published.