SAS 考题 123

2019-04-16 15:13

SAS 考题 123

Base SAS 1

The following SAS program is submitted: data test;

set sasuser.employees;

if 2 le years_service le 10 then amount = 1000;

else if years_service gt 10 then amount = 2000; else

amount = 0;

amount_per_year = years_service / amount; run;

Which one of the following values does the variable AMOUNT_PER_YEAR contain if an employee has been with the company for one year? A. 0 B. 1000 C. 2000

D. . (missing numeric value)

Answer is D.

Base SAS 2

The following SAS program is submitted: data test;

set sasuser.employees;

if 2 le years_service le 10 then amount = 1000;

else if years_service gt 10 then amount = 2000; else

amount = 0;

amount_per_year = years_service / amount; run;

1

Which one of the following values does the variable AMOUNT_PER_YEAR contain if an employee has been with the company for one year? A. 0 B. 1000 C. 2000

D. . (missing numeric value)

Answer is B/D 1

The following SAS program is submitted: data test;

set sasuser.employees;

if 2 le years_service le 10 then amount = 1000;

else if years_service gt 10 then amount = 2000; else

amount = 0;

amount_per_year = years_service / amount; run;

Which one of the following values does the variable AMOUNT_PER_YEAR contain if an employee has been with the company for one year? A. 0 B. 1000 C. 2000

D. . (missing numeric value) 2

The contents of the raw data file AMOUNT are listed below: --------10-------20-------30 $1,234

The following SAS program is submitted: data test;

infile 'amount'; input @1 salary 6.;

if _error_ then description = 'Problems'; else description = 'No Problems'; run;

Which one of the following is the value of the DESCRIPTION variable? A. Problems B. No Problems

2

C. ' ' (missing character value)

D. The value can not be determined as the program fails to execute due to errors. 3

The contents of the raw data file NAMENUM are listed below: --------10-------20-------30 Joe xx

The following SAS program is submitted: data test;

infile 'namenum'; input name $ number; run;

Which one of the following is the value of the NUMBER variable? A. xx B. Joe

C. . (missing numeric value)

D. The value can not be determined as the program fails to execute due to errors. 4

The contents of the raw data file NAMENUM are listed below: --------10-------20-------30 Joe xx

The following SAS program is submitted: data test;

infile 'namenum'; input name $ number; run;

Which one of the following is the value of the NUMBER variable? A. xx B. Joe

C. . (missing numeric value)

D. The value can not be determined as the program fails to execute due to errors. 5

The contents of the raw data file AMOUNT are listed below: --------10-------20-------30 $1,234

The following SAS program is submitted: data test;

infile 'amount'; input @1 salary 6.; run;

Which one of the following is the value of the SALARY variable? A. 1234

3

B. 1,234 C. $1,234

D. . (missing numeric value) 6

Which one of the following statements is true regarding the SAS automatic _ERROR_ variable? A. The _ERROR_ variable contains the values 'ON' or 'OFF'.

B. The _ERROR_ variable contains the values 'TRUE' or 'FALSE'.

C. The _ERROR_ variable is automatically stored in the resulting SAS data set.

D. The _ERROR_ variable can be used in expressions or calculations in the DATA step. 7

Which one of the following is true when SAS encounters a data error in a DATA step? A. The DATA step stops executing at the point of the error, and no SAS data set is created.

B. A note is written to the SAS log explaining the error, and the DATA step continues to execute. C. A note appears in the SAS log that the incorrect data record was saved to a separate SAS file for further examination.

D. The DATA step stops executing at the point of the error, and the resulting DATA set contains observations up to that point. 8

The following SAS program is submitted: data work.totalsales (keep = monthsales{12} ); set work.monthlysales (keep = year product sales); array monthsales {12} ; do i=1 to 12;

monthsales{i} = sales; end; run;

The data set named WORK.MONTHLYSALES has one observation per month for each of five years for a total of 60 observations.

Which one of the following is the result of the above program? A. The program fails execution due to data errors. B. The program fails execution due to syntax errors.

C. The program executes with warnings and creates the WORK.TOTALSALES data set.

D. The program executes without errors or warnings and creates the WORK.TOTALSALES data set.

9 The following SAS program is submitted: data work.totalsales;

set work.monthlysales(keep = year product sales); retain monthsales {12} ; array monthsales {12} ; do i = 1 to 12;

4

monthsales{i} = sales; end; cnt + 1;

monthsales{cnt} = sales; run;

The data set named WORK.MONTHLYSALES has one observation per month for each of five years for a total of 60 observations.

Which one of the following is the result of the above program? A. The program fails execution due to data errors. B. The program fails execution due to syntax errors.

C. The program runs with warnings and creates the WORK.TOTALSALES data set with 60 observations.

D. The program runs without errors or warnings and creates the WORK.TOTALSALES data set with 60 observations. 10

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. 11

The contents of the raw data file CALENDAR are listed below: --------10-------20-------30 01012000

The following SAS program is submitted: data test;

infile 'calendar';

input @1 date mmddyy10.;

if date = '01012000'd then event = 'January 1st'; run;

Which one of the following is the value of the EVENT variable? A. 01012000 B. January 1st

C. . (missing numeric value)

D. The value can not be determined as the program fails to execute due to errors.

5


SAS 考题 123.doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:【精品】2018年四川省德阳市中考生物试卷及答案

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

马上注册会员

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