Click on the Comments to view the Answers

Wednesday, January 27, 2010

Q8

The following SAS program is submitted:

data work.test;
array agents{4} $ 12 sales1 - sales4;
run;

Which one of the following represents the variables that are contained in the output data set?

A. SALES1, SALES2, SALES3, SALES4
B. AGENTS1, AGENTS2, AGENTS3, AGENTS4
C. None, the DATA step fails because the ARRAY statement can reference only numeric data.
D. None, the DATA step fails because the ARRAY statement can reference only pre-existing variables.

12 comments:

SASGuru said...

Answer: A

In this datastep the array is creating 4 character variable sales1-sales

Rujuta........ said...

A. SALES1, SALES2, SALES3, SALES4

siva said...

Answer A

hemanth said...

plz SASGure can u explain how.....

CP said...

Is12 the length of the var sales1-sales4

Ryan Lo said...

Answer is A.

"array agents{4} $ 12 sales1 - sales4;" statement
is creating 4 character variable sales1-sales with missing value. Output data set has one observation.

"array agents{4} $ 12;" statement
is creating 4 character variable agents1 - agents4 with missing value. Output data set has one observation.

kinnari said...

A
SALES1,SALES2,SALES3,SALES4

Gaurav said...

A

digitizer said...

The only thing that is throwing me is the number 12.

Unknown said...

A

Unknown said...

By default all elements in a character array is having a length of 8 bytes. To give a different length we can mention the value after the dollar sign. So in this case 12 is the length of each array element

Unknown said...

By default all elements in a character array is having a length of 8 bytes. To give a different length we can mention the value after the dollar sign. So in this case 12 is the length of each array element

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