Click on the Comments to view the Answers

Wednesday, January 27, 2010

Base 52

The following SAS program is submitted:

data work.empsalary;
set work.people (in = inemp) (in = insal);
if insal and inemp;

The SAS data set WORK.PEOPLE has 5 observations, and the data set WORK.MONEY has 7 observations.

How many observations will the data set WORK.EMPSALARY contain?
A. 0
B. 5
C. 7
D. 12


SASGuru said...

Answer: A
Since there is no BY statement..this is an example of concatenation…there is no match between each of the datasets…therefore 0 records in the output dataset

siva said...

Thanks for Answer SASGuru....

Reebok said...

wait a minute! shouldn't there be 12? i thought concatenation would append one file over the other.

Reebok said...

nevermind. the "if insal and inemp;" statement create no matches, therefore no records.

Amit said...

In concatenation...SAS reads 1 dataset first and then the second. So if you specify IN=variable for both datasets and wants to know that whether both the dataset contributed to the current observation seems to be a false idea bcoz 1 dataset get reads first and then the second.So no matches.
Hence answer is A.

Stevina Rumao said...

YES Amit that's the right explanation of the answer

Yasmin White said...

This is not just a SET statement. It has a IN=variable for both datasets. BUT there is no by statement. So the answer is 0 match. Answer is A

Unknown said...

Not enough info given... if you run

data test;
input obs name $ level;
1 Frank 1
2 Joan 2
3 Sui 2
4 Jose 3
5 Burt 4
6 Kelly .
7 Juan 1
data test2;
input obs name $ level;
1 Frank 1
2 Joan 2
3 Sui 2
4 Jose 3

data mergetest;
merge test(in=a) test2(in=b);
if a and b;

then there are 4 obs in the merged set.

We are not told in the question that the two sets do/do not have matching rows.

Harsh Mohan said...

For latest and updated SAS certification dumps in PDF format contact us at
Refer our blog for more details

Tony Rees said...

hi unknown run your code again this time without the merge and replace with set !

This is not a merge question it is a concatenation

Post a Comment

Technology Top Blogs On our way to 1,000,000 rss feeds - Blog Directory - blogarama - the blog directory Blog Directory

SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.

Other brand and product names are trademarks of their respective companies.

This blog is not responsible for any kind of copyright violation. This blog just collects the links hosted or posted by other servers/people/search engines.The creator of this page or the ISP(s) hosting any content on this site take no responsibility for the way you use the information provided on this site.If anybody has any copyright claim on it and doesn’t wish the information provided to be shown on our site, please do respond to this email. We shall remove them off immediately. Any inconvenience is regretted. Please do mention your exact grievance/problems with respect to certain third party links. We assure you that appropriate action will be taken off. Thank you