文档详情

2023年SASBase认证考试合集完整版

回****
实名认证
店铺
DOC
35.50KB
约13页
文档ID:166415232
2023年SASBase认证考试合集完整版_第1页
1/13

SAS Base认证考试—70题(51-60)Q 51 The following program is submitted:  proc contents data=_all_;  run;Which statement best describes the output from the submitted program? A. The output contains only a list of the SAS data sets that are contained in the WORK library. B. The output displays only the contents of the SAS data sets that are contained in the WORK library.C. The output displays only the variables in the SAS data sets that are contained in the WORK library.D. The output contains a list of the SAS data sets that are contained in the WORK library and displays the contents of those data sets.答案:D 本题知识点:PROC COTENTS过程参考第22题。

 Q 52Given the SAS data set WORK.EMP_NAME:  Name  EmpID  ----  -----  Jill   1864  Jack   2121  Joan   4698  John   5463Given the SAS data set WORK.EMP_DEPT:  EmpID  Department  -----  ----------   2121  Accounting   3567  Finance   4698  Marketing    5463  AccountingThe following program is submitted:  data WORK.ALL;     merge WORK.EMP_NAME(in=Emp_N)            WORK.EMP_DEPT(in=Emp_D);     by Empid;      if (Emp_N and not Emp_D) or (Emp_D and not Emp_N);  run;How many observations are in data set WORK.ALL after submitting the program?A. 1 B. 2 C. 3 D. 5 答案:B 本题知识点:MERGE合并数据集、IF子集找出两个数据集中不重合的观测个数。

 Q 53The following SAS program is submitted:  data WORK.TOTAL_SALARY;     retain Total;      set WORK.SALARY;     by Department;     if First.Department        then Total=0;     Total=sum(Total, Wagerate);     if Last.Total;  run;What is the initial value of the variable Total?A. 0B. MissingC. The value of the first observations WagerateD. Cannot be determined from the information given答案:B 本题知识点:RETAIN语句retain语句是非执行语句 retain; /*针对所有变量*/retain x y;retain x1-x5;retain x1-x5 1 0 a b ‘abc’;retain x1-x5(1); /*x1=1,其余为缺失值*/retain x1-x4(1 2 3 4);retain x1-x4(1:4);array arr(2) x y;retain arr; Q 54Consider the following data step: data WORK.TEST;    set SASHELP.CLASS(obs=5);    retain City 'Beverly Hills';    State='California';  run; The computed variables City and State have their values assigned using two different methods, a RETAIN statement and an Assignment statement. Which statement regarding this program is true?A. The RETAIN statement is fine, but the value of City will be truncated to 8 bytes as the LENGTH statement has been omitted.B. Both the RETAIN and assignment statement are being used to initialize new variables and are equally efficient. Method used is a matter of programmer preference.C. The assignment statement is fine, but the value of City will be truncated to 8 bytes as the LENGTH statement has been omitted.D. City's value will be assigned one time, State's value 5 times.答案:D本题知识点:RETAIN语句一般,SAS每读一遍DATA步的所有语句,PDV清空所有所有变量值,并设立为缺失值。

再执行INPUT语句或赋值语句,再次对变量赋值假如在DATA步中使用RETAIN语句,不会清空RETAIN相应的变量,保存到该变量下次再次被执行  Q 55The following SAS program is submitted:  data WORK.DATE_INFO;      X="01Jan1960" D ;   run; Variable X contains what value?A. the numeric value 0 B. the character value "01Jan1960"C. the date value 01011960 D. the code contains a syntax error and does not execute. 答案:D本题知识点:日期时间的表达格式起点:1960年1月1日0时0分0秒若将日期时间标示为数值型常数,需使用相应格式格式值带单引号,后紧跟跟一个D(日期)、T(时间)、DT(日期时间)在表达为数值常数时,不支持MMDDYYw.格式,支持datew.格式本题,答案C,是由于X="01Jan1960" D ;中D之前有个空格。

若改为 X="01Jan1960"D ; ,答案就是A若改为 X="01011960"D ; ,答案就是D Q 56The following output is created by the FREQUENCY procedure:        The FREQ Procedure       Table of region by product  region      product  Frequency|   Percent  |   Row Pct  |   Col Pct  |corn    |cotton  |oranges |  Total   ---------+--------+--------+--------+  EAST     |      2 |      1 |      1 |      4            |  22.22 |  11.11 |  11.11 |  44.44            |  50.00 |  25.00 |  25.00 |           |  50.00 |  33.33 |  50.00 |  ---------+--------+--------+--------+  SOUTH    |      2 |      2 |      1 |      5            |  22.22 |  22.22 |  11.11 |  55.56            |  40.00 |  40.00 |  20.00 |           |  50.00 |  66.67 |  50.00 |  ---------+--------+--------+--------+  Total           4        3        2        9               44.44    33.33    22.22   100.00 Which TABLES statement was used to completed the following program that produced the output?  proc freq data=sales;  <_insert_code_>   run;A. tables region product;B. tables region,productC. tables region/product;D. tables region*product;答案:D 本题知识点:PROC FREQ过程参考第47题。

 Q 57Given the SAS data set WORK.ONE:    N   BeginDate   -   ---------   1   09JAN2023   2   12JAN2023The following SAS program is submitted:  data WORK.TWO;     set WORK.ONE;      Day=<_insert_code_>;      format BeginDate date9.;  run;The data set WORK.TWO is created, where Day would be 1 for Sunday, 2 for Monday, 3 for Tuesday, ... :  WORK.TWO    N   BeginDate   Day    -   ---------   ---    1   09JAN2023     1    2   12JAN2023     4 Which expression successfully completed the program and creates the variable Day?A. day(BeginDate)B. weekday(BeginDate)C. dayofweek(BeginDate) D. getday(BeginDate,today())答案:B 本题知识点:日期时间函数WEEKDAY(date)返回SAS日期值为一周的第几天 Q 58The following program is submitted:  proc format;      value salfmt.         0 -< 50000   = 'Less than 50K'        50000 - high = '50K or Greater';   options fmterr nodate pageno=1;  title 'Employee Report';   proc print data=work.employees noobs;     var fullname salary hiredate;      format        salary salfmt.         hiredate date9.;     label         fullname='Name of Employee'        salary='Annual Salary'         hiredate='Date of Hire';  run;Why does the program fail?A. The PAGENO option is invalid in the OPTIONS statement.B. The RUN statement is missing after the FORMAT procedure. C. The format name contains a period in the VALUE statement.D. The LABEL option is missing from the PROC PRINT statement.答案:C 本题知识点:FORMAT语句、PROC FORMAT过程参考第9题。

 Q 59Given the contents of the raw data file TYPECOLOR.DAT:   ----+----10---+----20---+----30  daisyyellowThe following SAS program is submitted:  data FLOWERS;     infile 'TYPECOLOR.DAT' truncover;     length        Type $ 5        Color $ 11;     input         Type $         Color $;  run;What are the values of the variables Type and Color?A. Type=daisy, Color=yellow B. Type=daisy, Color=wC. Type=daisy, Color=daisyyellowD. Type=daisy, Color=答案:D 本题知识点:INFILE语句参考第5题 Q 60Given the SAS data set WORK.PRODUCTS:  ProdId    Price    ProductType    Sales    Returns   ------    -----    -----------    -----    -------   K12S      95.50    OUTDOOR           15          2   B132S      2.99    CLOTHING         300         10   R18KY2    51.99    EQUIPMENT         25          5   3KL8BY     6.39    OUTDOOR          125         15   DY65DW     5.60    OUTDOOR           45          5   DGTY23    34.55    EQUIPMENT         67          2 The following SAS program is submitted:  data WORK.REVENUE(drop=Sales Returns Price);     set WORK.PRODUCTS(keep=ProdId Price Sales Returns);      Revenue=Price*(Sales-Returns);  run;How many variables does the WORK.REVENUE data set contain?A. 2 B. 3 C. 4 D. 6 答案:A 本题知识点:DROP=选项,类似KEEP=及KEEP语句参考第6题。

下载提示
相关文档
正为您匹配相似的精品文档