SAS Base Certification – Question 8

Question 8: This question will ask you to provide a line of missing code.
 
Given the following data set WORK.SALES:

SalesID  SalesJan  FebSales  MarchAmt
-------  --------  --------  --------
W6790          50       400       350
W7693          25       100       125
W1387           .       300       250

The following SAS program is submitted:

1
2
3
4
5
data WORK.QTR1;
   set WORK.SALES;
   array month{3} SalesJan FebSales MarchAmt;
   <insert code here>
run;

Which statement should be inserted to produce the following output?

SalesID  SalesJan  FebSales  MarchAmt  Qtr1
-------  --------  --------  --------  ----
W6790          50       400       350   800
W7693          25       100       125   250
W1387           .       300       250   550

Options:

A.	Qtr1 = sum(of month{_ALL_}); 
B.	Qtr1 = month{1} + month{2} + month{3}; 
C.	Qtr1 = sum(of month{*}); 
D.	Qtr1 = sum(of month{3}); 

*The SAS certification sample problem and answer above are sourced from the official SAS sample questions page. All answer logs, data sets, output, and commentary are provided by this blog.

Correct Answer

Incorrect Answer

Click to see Answer Explanation below

thanks for your support

3 Comments

    Rupesh Chandra Das C Das Aug 07, 2016

    I did not understand the 4 th and 5th arguments how does it work? Can you give me an example? Thank you

    Reply
      Rupesh Chandra Das C Das Aug 07, 2016

      I mean the explanation is given for this question and He mentioned 5 valid arguments about sum function.

      Reply
    Linda Aug 23, 2016

    Refer to the Paul Dickman Sum website mentioned in Commentary prior to the 5 arguments! Good Luck

    Reply

Leave a Comment

Please keep in mind that comments are moderated and rel="nofollow" is in use. So, please do not use a spammy keyword or a domain as your name, or it will be deleted. Let us have a personal and meaningful conversation instead.