SAS 考题 123(4)

2019-04-16 15:13

The following SAS program is submitted: data bonus;

infile 'file-specification';

input dept $ 1 - 11 number 13 - 15; run;

Which one of the following SAS statements completes the program and results in a value of 'Printing750' for the DEPARTMENT variable?

A. department = trim(dept) number; B. department = dept input(number,3.); C. department = trim(dept) put(number,3.);

D. department = input(dept,11.) input(number,3.); 39

The following SAS program is submitted: data work.month;

date = put('13mar2000'd,ddmmyy10.); run;

Which one of the following represents the type and length of the variable DATE in the output data set?

A. numeric, 8 bytes B. numeric, 10 bytes C. character, 8 bytes D. character, 10 bytes 40

The following SAS program is submitted: data work.month;

date = input('13mar2000',date9.); run;

Which one of the following represents the type and length of the variable DATE in the output data set?

A. numeric, 8 bytes B. numeric, 9 bytes C. character, 8 bytes D. character, 9 bytes 41

The following SAS program is submitted: data work.products;

Product_Number = 5461; Item = '1001';

Item_Reference = Item'/'Product_Number;

16

run;

Which one of the following is the value of the variable ITEM_REFERENCE in the output data set? A. 1001/5461 B. 1001/ 5461

C. . (missing numeric value)

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

The following SAS program is submitted: data work.retail; cost = '20000'; total = .10 * cost; run;

Which one of the following is the value of the variable TOTAL in the output data set? A. 2000 B. '2000'

C. . (missing numeric value) D. ' ' (missing character value) 43

Which one of the following SAS statements correctly computes the average of four numerical values?

A. average = mean(num1 - num4); B. average = mean(of num1 - num4); C. average = mean(of num1 to num4);

D. average = mean(num1 num2 num3 num4); 44

The following SAS program is submitted: data work.test;

Author = 'Agatha Christie';

First = substr(scan(author,1,' ,'),1,1); run;

Which one of the following is the length of the variable FIRST in the output data set? A. 1 B. 6 C. 15 D. 200 45

The following SAS program is submitted: data work.test;

Author = 'Christie, Agatha';

First = substr(scan(author,2,' ,'),1,1);

17

run;

Which one of the following is the value of the variable FIRST in the output data set? A. A B. C

C. Agatha

D. ' ' (missing character value) 46

The following SAS program is submitted: data work.test;

Title = 'A Tale of Two Cities, Charles J. Dickens'; Word = scan(title,3,' ,'); run;

Which one of the following is the value of the variable WORD in the output data set? A. T B. of

C. Dickens

D. ' ' (missing character value) 47

The following SAS program is submitted: data work.test;

First = 'Ipswich, England';

City_Country = substr(First,1,7)!!', '!!'England'; run;

Which one of the following is the length of the variable CITY_COUNTRY in the output data set? A. 6 B. 7 C. 17 D. 25 48

The following SAS program is submitted: data work.test;

First = 'Ipswich, England'; City = substr(First,1,7);

City_Country = City!!', '!!'England'; run;

Which one of the following is the value of the variable CITY_COUNTRY in the output data set? A. Ipswich!!

B. Ipswich, England C. Ipswich, 'England' D. Ipswich , England

18

49

Which one of the following is true of the RETAIN statement in a SAS DATA step program? A. It can be used to assign an initial value to _N_ . B. It is only valid in conjunction with a SUM function.

C. It has no effect on variables read with the SET, MERGE and UPDATE statements.

D. It adds the value of an expression to an accumulator variable and ignores missing values. 50

A raw data file is listed below: --------10-------20-------30 1901 2 1905 1 1910 6 1925 . 1941 1

The following SAS program is submitted and references the raw data file above: data coins;

infile 'file-specification'; input year quantity; run;

Which one of the following completes the program and produces a non-missing value for the variable TOTQUANTITY in the last observation of the output data set? A. totquantity + quantity;

B. totquantity = sum(totquantity + quantity); C. totquantity 0; sum totquantity;

D. retain totquantity 0;

totquantity = totquantity + quantity; 51

A raw data file is listed below: --------10-------20-------30 squash 1.10 apples 2.25 juice 1.69

The following SAS program is submitted using the raw data file above: data groceries;

infile 'file-specification'; input item $ cost; run;

Which one of the following completes the program and produces a grand total for all COST values?

19

A. grandtot = sum cost;

B. grandtot = sum(grandtot,cost); C. retain grandtot 0;

grandtot = sum(grandtot,cost); D. grandtot = sum(grandtot,cost); output grandtot; 52

The following SAS program is submitted: data work.total;

set work.salary(keep = department wagerate); by department;

if first.department then payroll = 0; payroll + wagerate; if last.department; run;

The SAS data set WORK.SALARY, currently ordered by DEPARTMENT, contains 100 observations for each of 5 departments.

Which one of the following represents how many observations the WORK.TOTAL data set contains? A. 5 B. 20 C. 100 D. 500 53

The following SAS program is submitted: data work.total;

set work.salary(keep = department wagerate); by department;

if first.department then payroll = 0; payroll + wagerate; if last.department; run;

The SAS data set named WORK.SALARY contains 10 observations for each department, currently ordered by DEPARTMENT.

Which one of the following is true regarding the program above? A. The BY statement in the DATA step causes a syntax error.

B. FIRST.DEPARTMENT and LAST.DEPARTMENT are variables in the WORK.TOTAL data set.

C. The values of the variable PAYROLL represent the total for each department in the WORK.SALARY data set.

D. The values of the variable PAYROLL represent a total for all values of WAGERATE in the WORK.SALARY data set.

20


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

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

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

马上注册会员

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