BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
CCraddock
Calcite | Level 5

I have a question about what the book says the answer should be.  It is Chapter 10 Quiz, Question 6. It goes as follows:

Q: Suppose you merge data sets Cert.Set1 and Cert.Set2 below: 
Q: Which output does the following program create? 
I picked A but it says the correct answer is C, even though C has ID 1129 in Set2 but not Set1, so seems like it would not qualify for the "if in1 and in2" portion. [Included a pfd photo of the Data sets]

 

data work.merged;
   merge cert.set1(in=in1) cert.set2(in=in2);
   by id;
   if in1 and in2;
run;
proc print data=work.merged;
run;

 

 
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

1) sometimes books have typos. Perhaps the CERT.SET1 id 1128 was supposed to be 1129 but check with the publisher for errata.

Note the answer C also has the age for most of the IDS as not matching in Cert1. OR you checked an answer guide to the wrong question/ code example?

I am not going to type that much data from a picture but the response C looks a lot more like it came from this code:

data work.merged;
   merge cert.set2(in=in1) cert.set1(in=in2);
   if in1 and in2;
run;

Notice there is no BY and the order of the sets is different. So the above matches the first record with the first record, regardless, and outputs the number of records that matches the smaller data set.

 

 

2) create the data sets and run the code and then you'll know exactly what happens for that data.

View solution in original post

3 REPLIES 3
ballardw
Super User

1) sometimes books have typos. Perhaps the CERT.SET1 id 1128 was supposed to be 1129 but check with the publisher for errata.

Note the answer C also has the age for most of the IDS as not matching in Cert1. OR you checked an answer guide to the wrong question/ code example?

I am not going to type that much data from a picture but the response C looks a lot more like it came from this code:

data work.merged;
   merge cert.set2(in=in1) cert.set1(in=in2);
   if in1 and in2;
run;

Notice there is no BY and the order of the sets is different. So the above matches the first record with the first record, regardless, and outputs the number of records that matches the smaller data set.

 

 

2) create the data sets and run the code and then you'll know exactly what happens for that data.

FreelanceReinh
Jade | Level 19

Maybe it's an educational trick. The authors knew: If they give a wrong answer, learners will think and discuss much longer about this exercise than they normally would -- until they're 100% sure that the printed answer must be wrong. Moreover, the feeling of success ("I'm a learner, but still I have spotted an error in the textbook") is a positive emotion, which can facilitate the learning process.

 

And yes, A is the correct answer.

bobpep212
Quartz | Level 8

Somewhat related...this is a BRAND NEW edition. Be prepared for stuff like that. I took the base certification in April and it was based on the 4th edition. When I was looking at the 4th edition, there were some similar issues with the chapter quizzes. Someone else I knew who was studying for the same exam had the book for the 3rd edition. There were multiple instances where the answer was A in the 3rd edition, but the same question had a different answer for A in the 4th edition and it was wrong. It definitely made me think about it more until I was convinced that I was right and the book was wrong. 

 

Also, I just looked at the table of contents for the fifth edition. I heard they were going to do this, but it looks like they don't have anything on reading in raw data!!! No column input, list input, formatted input. I don't see any pointer controls, creating variables with INPUT statements, missover options...nothing. None of that fun stuff! I'm not sure if that's covered in the exam, but not in the new edition.

 

Anyway, good luck. I'm glad I learned all that reading in raw data, but it was definitely a challenge to keep all the different input options straight, so IMO, you're lucky to be taking it now, assuming that's not in the exam. 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1334 views
  • 3 likes
  • 4 in conversation