Question : The following SAS program is submitted: data work.passengers; if OrigPassengers = then OrigPassengers = 100; TransPassengers = 100; OrigPassengers = TotalPassengers = sum (OrigPassengers, TransPassengers) +0; run; What is the value of the TOTALPASSENGERS variable in the output data set? 1. 0 2. 100 3. 200 4. (missing numeric value)
Correct Answer : Get Lastest Questions and Answer : Exp: Returns the sum of the nonmissing arguments. Syntax : SUM(argument,argument,... ) Required Argument : argument : specifies a numeric constant, variable, or expression. If all the arguments have missing values, then one of the following occurs: If you use only one argument, then the value of that argument is returned. If you use two or more arguments, then a standard missing value (.) is returned. Otherwise, the result is the sum of the nonmissing values. The argument list can consist of a variable list, which is preceded by OF. Example : The following SAS statements produce these results. x1=sum(4,9,3,8); => 24 x2=sum(4,9,3,8,.); => 24
Question : Given the SAS data set PRICES: PRICES Prodid priceproducttypesalesreturns K1255.10NETWORK152 B132S 2.34HARDWARE30010 R18KY2 1.29SOFTWARE255 3KL8BY 6.37HARDWARE12515 DY65DW 5.60HARDWARE455 DGTY23 4.55HARDWARE672 The following SAS program is submitted: data hware inter cheap; set prices(keep = productype price); if producttype = `HARDWARE' then output hware; else if producttype = `NETWORK' then output inter; if price le 5.00; run; if producttype = `HARDWARE' then output hware; else if producttype = `NETWORK' then output inter; if price le 5.00; run; How many observations does the HWARE data set contain?