SAS-base-考试必备-70真题(附答案)(4)

2018-12-19 21:21

3 3 June 76 4 15 June 80 5 2 July 85 6 14 July 89

D.

Obs Day Month Temp --- --- ----- ----

1 15 May 70 2 1 May 75 3 15 June 80 4 3 June 76 5 14 July 89 6 2 July 85

Answer: C

-------------------------------------

28.Given the SAS data set WORK.P2000:

Location Pop2000 -------- -------

Alaska 626931 Delaware 783595 Vermont 608826 Wyoming 493782

and the SAS data set WORK.P2008:

State Pop2008 -------- -------

Alaska 686293 Delaware 873092 Wyoming 532668

The following output is desired:

Obs State Pop2000 Pop2008 1 Alaska 626931 686293 2 Delaware 783595 873092 3 Wyoming 493782 532668

Which SAS program correctly combines the data?

Difference 59362 89497 38886

A. data compare;

merge WORK.P2000(in=_a Location=State) WORK.P2008(in=_b); by State; if _a and _b;

Difference=Pop2008-Pop2000; run;

B.

data compare;

merge WORK.P2000(rename=(Location=State)) WORK.P2008; by State; if _a and _b;

Difference=Pop2008-Pop2000; run;

C.

data compare;

merge WORK.P2000(in=_a rename=(Location=State)) WORK.P2008(in=_b); by State; if _a and _b;

Difference=Pop2008-Pop2000; run;

D.

data compare;

merge WORK.P2000(in=_a) (rename=(Location=State)) WORK.P2008(in=_b); by State; if _a and _b;

Difference=Pop2008-Pop2000; run;

Answer: C

-------------------------------------

29.The following SAS program is sumbitted:

data WORK.INFO;

infile 'DATAFILE.TXT';

input @1 Company $20. @25 State $2. @; if State=' ' then input @30 Year; else input @30 City Year; input NumEmployees; run;

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

A. 1 B. 2 C. 3 D. 4

Answer: A

-------------------------------------

30.You're attempting to read a raw data file and you see the following messages displayed in the SAS Log:

NOTE: Invalid data for Salary in line 4 15-23.

RULE: ----+----1----+----2----+----3----+----4----+----5-- 4 120104 F 46#30 11MAY1954 33

Employee_Id=120104 employee_gender=F Salary=. birth_date=-2061 _ERROR_=1 _N_=4

NOTE: 20 records were read from the infile 'c:\\employees.dat'. The minimum record length was 33. The maximum record length was 33.

NOTE: The data set WORK.EMPLOYEES has 20 observations and 4 variables.

What does it mean?

A. A compiler error, triggered by an invalid character for the variable Salary. B. An execution error, triggered by an invalid character for the variable Salary. C. The 1st of potentially many errors, this one occurring on the 4th observation. D. An error on the INPUT statement specification for reading the variable Salary.

Answer: B

------------------------------------------------------------------

31. Given the following raw data records in DATAFILE.TXT:

----|----10---|----20---|----30

Kim,Basketball,Golf,Tennis Bill,Football

Tracy,Soccer,Track

The following program is submitted:

data WORK.SPORTS_INFO;

length Fname Sport1-Sport3 $ 10; infile 'DATAFILE.TXT' dlm=',';

input Fname $ Sport1 $ Sport2 $ Sport3 $; run;

proc print data=WORK.SPORTS_INFO; run;

Which output is correct based on the submitted program?

A.

Obs Fname Sport1 Sport2 Sport3

1 Kim Basketball Golf Tennis 2 Bill Football

3 Tracy Soccer Track

B.

Obs Fname Sport1 Sport2 Sport3

1 Kim Basketball Golf Tennis 2 Bill Football Football Football 3 Tracy Soccer Track Track

C.

Obs Fname Sport1 Sport2 Sport3

1 Kim Basketball Golf Tennis 2 Bill Football Tracy Soccer

D.

Obs Fname Sport1 Sport2 Sport3

1 Kim Basketball Golf Tennis 2 Bill Football

Answer: C

------------------------------------------------------------------ 32.Consider the following data step:

data WORK.NEW; set WORK.OLD; Count+1; run;

The variable Count is created using a sum statement. Which statement regarding this variable is true?

A. It is assigned a value 0 when the data step begins execution.

B. It is assigned a value of missing when the data step begins execution. C. It is assigned a value 0 at compile time.

D. It is assigned a value of missing at compile time.

Answer: C

------------------------------------------------------------------

33.The following SAS program is submitted:

data WORK.TEST; set WORK.PILOTS;

if Jobcode='Pilot2' then Description='Senior Pilot'; else Description='Unknown'; run;

The value for the variable Jobcode is: PILOT2.What is the value of the variable Description? A. PILOT2 B. Unknown C. Senior Pilot

D. ' ' (missing character value)

Answer: B

------------------------------------------------------------------

34.A user-defined format has been created using the FORMAT procedure.How is it stored?

A. in a SAS catalog

B. in a memory resident lookup table C. in a SAS dataset in the WORK library

D. in a SAS dataset in a permanent SAS data library

Answer: A


SAS-base-考试必备-70真题(附答案)(4).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:石油化工企业消防战训工作的研究

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: