Click on the Comments to view the Answers

Wednesday, January 27, 2010

Base 51

The following SAS program is submitted:




data numrecords;

infile 'file-specification';

input @1 patient $15. relative $ 16-26 @;

if relative = 'children' then input @54 diagnosis $15. @;

else if relative = 'parents' then input @28 doctor $15. clinic $ 44-53 @54 diagnosis $15. @;

input age;

run;



How many raw data records are read in each iteration of the DATA step during execution?

A. 1

B. 2

C. 3

D. 4

7 comments:

SASGuru said...

Answer: A
Here we need to determine how many records will each iteration read from the raw data file.
Remember the trailing @ definition, the next input statement will read from the current record in the same datastep iteration…So when we are using @ the total number of iterations would be directly proportional to the number of records in the raw data file….
Take a hard look at each of the input statements the record ends a position 54 for diagnosis variable and a trailing @…so the variable age reads at probably 69 or before depending on the length of diagnosis…So each iteration would require only record from the data file.

siva said...

Answer A

Mohit Thakur said...
This comment has been removed by the author.
chetan chavan said...

great answer thanks

RS said...

where is raw data where it is coming from?

Harsh Mohan said...

For latest and updated SAS certification dumps in PDF format contact us at completeexamcollection@gmail.com.
Refer our blog for more details
http://completeexamcollection.blogspot.in/2015/12/sas-certification-dumps.html

John Sebring said...

I hate to be overly pedantic but the answer depends on the length of the input record. A shorter record will finish inputting prior to the 'input age;' being applied and thus act on the next record.

For Short data records, 2 records are read in while for longer data records only 1 record is read in.

data numrecords;
infile cards;
input @1 patient $15. relative $ 16-26 @;

if relative = 'children' then input @54 diagnosis $15. @;

else if relative = 'parents' then input @28 doctor $15. clinic $ 44-53 @54 diagnosis $15. @;

input age;
cards;
john children asdfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
mark parents asdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
bill asdflasdfl
mary lkasdfjds
;
run;


proc print;
run;

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