SAS Base Certification Practice – Question 9

Question 9: The following SAS program is submitted:
 

1
2
3
4
5
6
data work.january;
set work.allmonths (keep = product month num_sold cost);
if month = 'jan' then output work.january;
sales = cost * num_sold;
keep = product sales;
run;

Which variables does the WORK.JANUARY data set contain?

Options:

A. PRODUCT and SALES only
B. PRODUCT, MONTH, NUM_SOLD and COST only
C. PRODUCT, SALES, MONTH, NUM_SOLD and COST only
D. An incomplete output data set is created due to syntax errors.

*This blog is not affiliated with SAS or the SAS Institute. 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

5 Comments

    RockyC Jul 30, 2015

    “WARNING: The data set WORK.JANUARY may be incomplete. When this step was stopped there were 0 observations and 6 variables.”

    6 variables – does this mean that the answer should be:
    PRODUCT, KEEP, SALES, MONTH, NUM_SOLD and COST?

    Reply
    Trushna Jan 11, 2016

    Syntax error because of keep = product sales;

    Reply
      Linda Aug 23, 2016

      Would it have worked if keep = followed by vars in ( )?

      Reply
        toan Oct 05, 2016

        Isn’t Var statement primarily for Proc Means/Summary for table analysis or Proc Print for outputting specific variables?

        Reply
    maksimk Oct 05, 2017

    Sometimes I just hate how SAS syntax is different the same things.

    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.