Advance SAS Cert Practice exam from SAS Institute (Q-32)

Reply
Contributor
Posts: 46

Advance SAS Cert Practice exam from SAS Institute (Q-32)

With reference to the above topic,I need some help beginning from the highlighted lines below. This is the explanation SAS gave to question 32. I 'm not in agreement with their explanation.
Thanks.
Given the following SAS data sets One and Two:
One
Obs Common X
1 A 10
2 A 13
3 A 14
4 B 9


Two
Obs Common Y
1 A 1
2 A 3
3 B 4
4 B 2

The following SAS program is submitted:
data combine;
merge one two;
by common;
run;

What data values are stored in the data set Combine?



The MERGE statement in the DATA step processes data sequentially. The first observation of data set One is combined with the first observation of data set Two because the variable Common has a value of A in both data sets.
The second observation of the data set One is combined with the second observation of the data set Two because the variable Common has a value of A in both data sets. Because there is an additional observation in the data set Two where the variable Common has a value of A, the program data vector is not reinitialized; the value of X is retained from observation two, and the values of Common and Y are read from the data set Two. Thus, there are three observations in the data set Combine where the variable Common has a value of A.
The third observation of the data set One is combined with the fourth observation of the data set Two because the variable Common has a value of B in both data sets.
Finally, the fourth observation of the data set One is combined with the last observation of the data set Two because the variable Common has a value of B in both data sets. Thus, there are two observations in the data set Combine where the variable Common has a value of B.
Super User
Posts: 5,382

Re: Advance SAS Cert Practice exam from SAS Institute (Q-32)

I take it that the bold sentence is bothering you.
This is probably a typo, I think it should read "..in the data set One...".

/Linus
Data never sleeps
Super Contributor
Posts: 359

Re: Advance SAS Cert Practice exam from SAS Institute (Q-32)

Clearly the paragraph does not match the data.
Ask a Question
Discussion stats
  • 2 replies
  • 337 views
  • 0 likes
  • 3 in conversation