I have a question about what the book says the answer should be. It is Chapter 10 Quiz, Question 6. It goes as follows:
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) 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.
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.
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.
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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.