SAS ADV 63 Details explanantion (by crackman).pdf

SAS ADV 63 Details explanantion (by crackman).pdf -...

This preview shows page 1 - 5 out of 64 pages.

特别感谢 Crackman 部分注释来自 crackman 博客 Item 1 of 63 Mark item for review When attempting to minimize memory usage, the most efficient way to do group processing when using the MEANS procedure is to use: A. the BY statement. B. GROUPBY with the NOTSORTED specification. C. the CLASS statement. D. multiple WHERE statements. C Item 2 of 63 Mark item for review The SAS data set WORK.CHECK has a variable named Id_Code in it. Which SQL statement would create an index on this variable? A. create index Id_Code on WORK.CHECK; B. create index(Id_Code) on WORK.CHECK; C. make index=Id_Code from WORK.CHECK; D. define index(Id_Code) in WORK.CHECK; A prepare guide chapter 6
Image of page 1

Subscribe to view the full document.

Item 3 of 63 Mark item for review Given the SAS data sets: WORK.EMPLOYEE WORK.NEWEMPLOYEE Name Dept Names Salary -------- ----- -------- ------ Alan Sales Michelle 50000 Michelle Sales Paresh 60000 A SAS program is submitted and the following is written to the SAS log: 101 proc sql; 102 select dept, name 103 from WORK.EMPLOYEE 104 where name=(select names from newemployee where salary > 40000) ERROR: Subquery evaluated to more than one row. 105 ; 106 quit; What would allow the program to successfully execute without errors? A. Replace the where clause with: where EMPLOYEE.Name=(select Names delimited with ',' from WORK.NEWEMPLOYEE where Salary > 40000); B. Replace line 104 with: where EMPLOYEE.Name =ANY (select Names separated with ',' from WORK.NEWEMPLOYEE where Salary > 40000); C.
Image of page 2
Replace the equal sign with the IN operator. D. Qualify the column names with the table names. C: 首先分析这个原程序第 104 行,中 where name=(select names from newemployee where salsry>40000) 原 程 序 在 执 行 过 程 , 应 先 是 执 行 子 查 询 , select names from newemployee where salsry>40000 ,将返回的结果作为下一个查询的筛选条件。 在这里返回的结果 NAMES 这个变量包括了两个值 Michelle Paresh ,所以在执行过程出现 错误。那么应该改成 IN 或者 ANY IN ANY 指定的是一个匹配范围,而等号必须是一个具体 匹配的值。 这里可以思考 SEPARATED WITH 这个语句, SAS 认为是错误 Item 4 of 63 Mark item for review Given the SAS data set SASUSER.HIGHWAY: Steering Seatbelt Speed Status Count -------- -------- ----- ------- ----- absent No 0-29 serious 31 absent No 0-29 not 1419 absent No 30-49 serious 191 absent no 30-49 not 2004 absent no 50+ serious 216 The following SAS program is submitted: proc sql noprint; select distinct Speed [_insert_SQL_clause_] from SASUSER.HIGHWAY ; quit; title1 "Speed values represented are: &GROUPS"; proc print data=SASUSER.HIGHWAY; run; Which SQL clause stores the text 0-29,30-49,50+ in the macro variable GROUPS? A.
Image of page 3

Subscribe to view the full document.

into &GROUPS B. into :GROUPS C. into :GROUPS separated by ',' D. into &GROUPS separated by ',' C: 此题考察的是 SQL 与宏的结合。 SQL 语句产生宏变量,语法结构如下: PROC SQL NOPRINT; SELECT column1<,column2,…> INTO :macro-variable-1<,:macro-variable- 2,…> FROM table-1 | view-1 <WHERE expression> <other clauses>; QUIT; 下面这个语法结构是将一变量的多个值组合在一个宏变量里面,例如: General
Image of page 4
Image of page 5
  • Fall '14

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern