第一范文网 - 专业文章范例文档资料分享平台

SAS 考题 123

来源:用户分享 时间:2019-04-16 本文由神明不渡我 分享 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

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

搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新综合文库SAS 考题 123全文阅读和word下载服务。

SAS 考题 123.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/wenku/132954.html(转载请注明文章来源)
热门推荐
Copyright © 2018-2022 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top