SAS Base Certification – Question 2

Question 2: Given the SAS data set WORK.ONE:

 Id Char1
--- -----
182 M
190 N
250 O
720 P

and the SAS data set WORK.TWO:

 Id Char2
--- -----
182 Q
623 R
720 S

The following program is submitted:

1
2
3
4
data WORK.BOTH;
 merge WORK.ONE WORK.TWO;
 by Id;
run;

What is the first observation in the SAS data set WORK.BOTH?

Options:

A.	Id Char1 Char2
--- ----- -----
182 M

B.	Id Char1 Char2
--- ----- -----
182 Q

C.	Id Char1 Char2
--- ----- -----
182 M Q

D.	Id Char1 Char2
--- ----- -----
720 P S

*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

7 Comments

    Uer Sep 25, 2016

    I agree with C. Why isnt ‘D’ also the correct answer? Please explain, Thanks

    Reply
      acrews7 Dec 28, 2016

      It completes in the order given. It asks for the first observation which would be the first observation line that is ran.

      Reply
      Hasan Apr 11, 2017

      Because 720 P S is not the first observation

      Reply
      Shubh Jul 30, 2017

      Because it has specifically asked for first observation.

      Reply
    RD Oct 24, 2016

    IT asked for by id so 182 comes first than 720

    Reply
    Arun Vaibhav Dec 03, 2016

    So SAS will not print 720 P S ?
    Because even that is also a match
    What if we want to print all the matches
    Rather than just first encounter,
    And why SAS prints only first match?
    Please explain.
    Thanks

    Reply
    Michael Jul 31, 2017

    Usr you asked the question, that I first asked. Then I remembered (from past experience) to reread and consider what ‘output’ was being specified. As others mentioned the question is very specific in asking for the 1st obs.

    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.