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.
Topics:
SAS Adv Questions |
5 Comments »
B
D: The New data set has 100 observations with 50 observations with missing values comming from the second data set.
B. Error and warning messages…
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.
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!