Click on the Comments to view the Answers

Monday, January 25, 2010

Base 37

In the following SAS program, the input data files are sorted by the NAMES variable:

libname temp 'SAS-data-library';
data temp.sales;
merge temp.sales work.receipt;
by names;
run;

Which one of the following results occurs when this program is submitted?
A. The program executes successfully and a temporary SAS data set is created.
B. The program executes successfully and a permanent SAS data set is created.
C. The program fails execution because the same SAS data set is referenced for both read and write operations.
D. The program fails execution because the SAS data sets on the MERGE statement are in two different libraries.

20 comments:

SASGuru said...

Answer: B
Even if the same named datasets are used in read and write, SAS first builds the observations in temporary memory and then overwrites the dataset

divya said...
This comment has been removed by the author.
divya said...

No, it doesn't work that way. SAS throws up an error stating the table doesn't exist. And merge principle works by reading the descriptor portion of the datasets first and then starts building up the new data set

so C is the answer

kat said...

It is not C. it does not matter if you use the same name in read and write. you can still merge two data sets. the problem is the by statement.

you can sort them once the two sets are merges by using proc sort data=temp.sales; by names;

So the only choice for this question is D.

kinnari said...

Answer is B

Krishna Rajwanshi said...

Hello,
The post are really catchy for Base SAS certification preparation

Amit said...

Yes the answer is B.

Option A - It cannot be A bcoz you are defining a library ref.hence output dataset is permanent dataset.

Option C- You can mention the same data set for read and write dataset. The same dataset will be overwritten(I tried it).

Option D - Well it doesn't matter if libraries are different as long as SAS knows where to find it. One library ref "temp" is already been mentioned and another one is "work".So it cant be D.

Only answer for the questions can be "B".

Vikas Sharma said...

Yes , the answer is B

deval patel said...

ans is B. I tried using below code..you can also try

libname testing "D:\";
data testing.test1;
input id $ age;
cards;
01 24
02 34
03 45
04 34
;

data test2;
input id $ gender $;
cards;
01 M
02 F
03 F
04 F
;

data testing.test1;
merge testing.test1 test2;
by id;
run;

training onlinesas said...

Nice information. Our institute Is the Leading online institute in Hyderabad, India to provide sas online trainings with the real time experts and certified professionals. alot sas Online Training.

Roshini RS said...

I think the Answer is B, thanks for sharing this valid information...sap training in Chennai

training onlinesas said...

Thank you provide valuable informations and iam seacrching same informations,and saved my time SAS Online Training

caroline jesi said...

Thanks for sharing these niche piece of info to our knowledge. Here, I had a solution for my inconclusive problems & it’s really helps me a lot keep updates…
Regards,
SAS Training in Chennai|SAS Course in Chennai

Priya said...

PHP provides the best option to build the website where we can design our website in a very interactive manner that provides better functioning in data management.
PHP Training in Chennai | PHP course in Chennai

Nikshitha S said...

Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
cloud computing training in chennai | cloud computing courses in chennai

Priya R said...

Updating with the latest technology and implementing it is the only way to survive in our niche. Thanks for making me this article. You have done a great job by sharing this content in here. Keep writing article like this.
SAS Training in Chennai | SAS Course in Chennai

Priya R said...

The strategy you have posted on this technology helped me to get into the next level and had lot of information in it. The python programming language is very popular and most widely used.
Python Training in Chennai | Python Course in Chennai

jahan bdreamz said...
This comment has been removed by the author.
jahan bdreamz said...

Nice post.This question will help me to got lot of information in it. You should implement the latest technologies.Thanks for sharing..,


SAS Training in Bangalore

sai venkat said...

Nice blog has been shared by you. it will be really helpful to many peoples who are all working under the technology.thank you for sharing this blog.

SAS Online Training
Tableau Online Training|
R Programming Online Training|

Post a Comment



Technology Top Blogs On our way to 1,000,000 rss feeds - millionrss.com Hihera.com Blog Directory - OnToplist.com blogarama - the blog directory Blog Directory
Disclaimer

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