SAS认证考试官方练习题集和校正答案 .doc
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《SAS认证考试官方练习题集和校正答案 .doc》由会员分享,可在线阅读,更多相关《SAS认证考试官方练习题集和校正答案 .doc(40页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、1.A raw data file is listed below.1-+-10-+-20-+-sonFrank 01/31/89 daughter June 12-25-87brother Samuel 01/17/51The following program is submitted using this file as input: data y; infile file-specification; run;Which INPUT statement correctly reads the values for the variable Birthdate as SAS date v
2、alues? a.input relation $ first_name $ birthdate date9.;b.input relation $ first_name $ birthdate mmddyy8.;c.input relation $ first_name $ birthdate : date9.;d.input relation $ first_name $ birthdate : mmddyy8.;Correctanswer: d An informat is used to translate the calendar date to a SAS date value.
3、The date values are in the form of two-digit values for month-day-year, so the MMDDYY8. informat must be used. When using an informat with list input, the colon-format modifier is required to correctly associate the informat with the variable name.You can learn about informats in Reading Date and Ti
4、me Values the colon-format modifier in Reading Free-Format Data. 2.A raw data file is listed below.1-+-10-+-20-+-Jose,47,210Sue,108The following SAS program is submitted using the raw data file above as input: data employeestats; input name $ age weight;run;The following output is desired:nameagewei
5、ghtJose47210Sue.108Which of the following INFILE statements completes the program and accesses the data correctly? a.infile file-specification pad;b.infile file-specification dsd;c.infile file-specification dlm=,;d.infile file-specification missover;Correctanswer: bThe PAD option specifies that SAS
6、pad variable length records with blanks. The MISSOVER option prevents SAS from reading past the end of the line when reading free formatted data. The DLM= option specifies the comma as the delimiter; however, consecutive delimiters are treated as one by default. The DSD option correctly reads the da
7、ta with commas as delimiters and two consecutive commas indicating a missing value like those in this raw data file. You can learn about the PAD option in Reading Raw Data in Fixed Fields the MISSOVER option in Creating Multiple Observations from a Single Record the DLM= option and the DSD option in
8、 Reading Free-Format Data. 3.The following program is submitted: data numrecords; infile cards dlm=,; input agent1 $ agent2 $ agent3 $;cards;jones,brownjones,spencer,brown;run;What is the value for the variable named Agent2 in the second observation? a.Brownb.Spencerc. (missing character value) d.Th
9、ere is no value because only one observation is created.Correctanswer: d The CARDS statement enables you to read instream data. Any number of consecutive commas are considered to be a single delimiter as a result of the DLM= option, and the length of each variable defaults to 8 bytes. Therefore, the
10、 values jones, brownjon, and spencer are assigned to Agent1, Agent2, and Agent3, respectively, for the first observation. The rest of the data on the record is not read by the INPUT statement and is not output to the data set.You can learn about the CARDS statement in Creating SAS Data Sets from Raw
11、 Data the default length of variables in Reading Free-Format Data. 4.A raw data file is listed below.1-+-10-+-20-+-30-+-40-+-50TWOSTORY 1040 21SANDERS ROAD$55,850CONDO2150 42.5JEANS AVENUE$127,150The following program is submitted using this file as input: data s; infile file-specification; run;Whic
12、h one of the following INPUT statements reads the raw data file correctly? a.input 1 style $8. +1 sqfeet 4. +1 bedrooms 1. 20 baths 3. street 16. 40 price dollar8;b.input 1 style $8 +1 sqfeet 4. +1 bedrooms 1. 20 baths 3. street $16 40 price dollar8.;c.input 1 style $8. +1 sqfeet 4. +1 bedrooms 1. 2
13、0 baths 3. street $16. 40 price dollar8.;d.input 1 style $8. +1 sqfeet 4. +1 bedrooms 1. 20 baths 3 street 16. 40 price dollar8.;Correctanswer: cFormatted input requires periods as part of the informat name. The period is missing from the variables Style and Street in Answer b, the variable Baths in
14、 Answer d, and the variable Price in Answer a (which is also missing a dollar sign to read the variable Street as a character value).You can learn about formatted input and informats in Reading Raw Data in Fixed Fields. 5.The following SAS program is submitted at the start of a new SAS session: libn
15、ame sasdata SAS-data-library;data ; set data; profit=expenses-revenues;run;proc print data=sales;run;The SAS data set data has ten observations. Which one of the following explains why a report fails to generate? a.The DATA step fails execution.b.The SAS data set Sales does not exist. c.The SAS data
16、 set Sales has no observations.d.The PRINT procedure contains a syntax error. Correctanswer: b The DATA step creates a permanent SAS data set, data. The PRINT procedure is printing a temporary SAS data set, Sales, that is stored in the Work library. At the beginning of the SAS session, does not exis
17、t.You can learn about creating permanent data sets with the DATA step in Creating SAS Data Sets from Raw Data temporary data sets in Basic Concepts. 6.Which action assigns a reference named SALES to a permanent SAS data library? a.Issuing the command: libref SALES SAS-data-libraryb.Issuing the comma
18、nd: libname SALES SAS-data-libraryc.Submitting the statement: libref SALES SAS-data-library;d.Submitting the statement: libname SALES SAS-data-library;Correctanswer: d The LIBNAME statement assigns a reference known as a libref to a permanent SAS data library. The LIBNAME command opens the LIBNAME w
19、indow.You can learn about the LIBNAME statement in Referencing Files and Setting Options. 7.The following SAS program is submitted: data newstaff; set staff; run;Which one of the following WHERE statements completes the program and selects only observations with a Hire_date of February 23, 2000? a.w
20、here hire_date=23feb2000d;b.where hire_date=23feb2000;c.where hire_date=02/23/2000d;d.where hire_date=02/23/2000;Correctanswer: a A SAS date constant must take the form of one- or two-digit day, three-digit month, and two- or four-digit year, enclosed in quotation marks and followed by a d (ddmmmyyd
21、).You can learn about SAS date constants in Creating SAS Data Sets from Raw Data. 8.Which one of the following SAS date formats displays the SAS date value for January 16, 2002 in the form of 16/01/2002? a.DATE10.b.DDMMYY10. c.WEEKDATE10. d.DDMMYYYY10.Correctanswer: b The requested output is in day-
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- SAS认证考试官方练习题集和校正答案 SAS 认证 考试 官方 习题集 校正 答案
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内