Click on the Comments to view the Answers

Sunday, January 24, 2010

Base 9

The following SAS program is submitted:


data work.january;
set work.allmonths (keep = product month num_sold cost);
if month = 'Jan' then output work.january;
sales = cost * num_sold;
keep = product sales;
run;


Which variables does the WORK.JANUARY data set contain?
A. PRODUCT and SALES only
B. PRODUCT, MONTH, NUM_SOLD and COST only
C. PRODUCT, SALES, MONTH, NUM_SOLD and COST only
D. An incomplete output data set is created due to syntax errors.

7 comments:

SASGuru said...

Answer: D

keep = product sales; causes a syntax error… A keep statement syntax does not have a = .

data work.january;
infile cards;
input product $ month $ num_sold cost;
if month = 'Jan' then output work.january;
sales = cost * num_sold;
keep product sales;
cards;
A Jan 10 20
B Feb 20 30
;
run;

Vikas said...

Correct Answer is (A). Question is asking about "Which variables does the WORK.JANUARY data set contain" and PRODUCT and SALES do appear in the incomplete dataset.

Geoff said...

Yeah. But I think this is going for which is the better answer and I have to agree with SASGuru. If you opened up the data set, it might have those variables listed as column names, but they should empty because the program will have failed to compile properly and not been able to fill them.

Unknown said...

Answer = A

the program has data errors not syntax errors mentioned on answer D

neurosas said...

D.
To SasGuru
data work.january;
infile cards;
input product $ month $ num_sold cost;
if month = 'Jan' then output work.january;
sales = cost * num_sold; /*statement place here produce missing value; if the statement moved before IF statement will provide numeric/*
keep product sales;
cards;
A Jan 10 20
B Feb 20 30
;
run;

Unknown said...

agree with SasGuru. Answer is D. it shows syntax error.

Jovelyn said...

I agree that there is a syntax error but the sas data set work.january still exist with 6 variables.

add proc contents to list the variables of work.january. The quiestion is: Which variables does the WORK.JANUARY data set contain? and "6" is not a choice

I think the question is flawed.

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