By admin | November 4, 2009

SAS Certified Adv Programmer 130 Questions (11)

The variable attributes of SAS data sets ONE and TWO are shown below:

ONE 
# Variable Type Len Pos 
2 sales    Num  8   8 
1 year     Num  8   0 

TWO
# Variable Type Len Pos
2 budget   Num  8   8
3 sales    Char 8   16
1 year     Num  8   0

Data set ONE contains 100 observations. Data set TWO contains 50 observations. Both data sets are sorted by the variable YEAR. The following SAS program is submitted:

data three;
    merge one two;
    by year; 
run;

Which one of the following is the result of the program execution?

A. No messages are written to the SAS log.
B. ERROR and WARNING messages are written to the SAS log.
C. Data set THREE is created with two variables and 50 observations.
D. Data set THREE is created with three variables and 100 observations.

5 comments | Add One

  1. admin - 11/4/2009 at 9:31 am

    B

  2. Consty - 02/19/2013 at 1:32 pm

    D: The New data set has 100 observations with 50 observations with missing values comming from the second data set.

  3. adi - 07/11/2013 at 1:22 pm

    B. Error and warning messages…

  4. flyingphx - 12/17/2013 at 9:36 am

    B is right answer.
    Variable Sales is both defined as numeric in one and character in two, that’s why there is an error message.

  5. chinawokee - 07/9/2014 at 11:21 pm

    B is correct!

    Any variables that have the same name in multiple data sets in the merge statement must also have the same type.
    Otherwise error and warning message would come out!

Leave a Comment

Leave a Reply

Your email address will not be published.