SAS ADV 63 With Explanation.pdf - 1 When attempting to...

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

Page 1 of 48 1. 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. Explanation: It alludes to the "standard" long-bearded practical trick used in the situation when MEANS/SUMMARY with CLASS uses too much memory. It does not ask what is more efficient in general (which would be to use something else instead of MEANS if possible), just what leads to the minimal memory footprint, and the answer is A. A : The reason is that without BY, MEANS creates and builds its AVL tree for the entire file and all categorical values crossings found in CLASS. With BY, the PROC builds the tree for the current BY group only, computes the stats, then erases the tree before the next BY group starts, creates and builds it again, and so on. The erase/create process is not a zero cost one, so the smaller the more numerous the BY groups are, the more it slows down the processing; however, the smaller is the largest BY group, the smaller is the memory footprint. B : Answer B is just a distraction - a common device in computer-adaptive tests. Experiments of CLASS with SAS: 12 proc means data=pilots; 13 class jobcode; 14 run; NOTE: There were 6 observations read from the data set WORK.PILOTS. NOTE: PROCEDURE MEANS used (Total process time): real time 0.56 seconds cpu time 0.29 seconds Experiments of BY with SAS: -------------------------------------------------------------------------- 15 proc means data=pilots; 16 by jobcode; 17 run; NOTE: There were 6 observations read from the data set WORK.PILOTS. NOTE: PROCEDURE MEANS used (Total process time): real time 0.10 seconds cpu time 0.03 seconds
Image of page 1

Subscribe to view the full document.

Page 2 of 48
Image of page 2
Page 3 of 48 2. The SAS data set WORK.CHECK has a variable named Id_Code in it. Which SQL statement would create an index on this variable? 3. 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. Replace the equal sign with the IN operator.
Image of page 3

Subscribe to view the full document.

Page 4 of 48 D. Qualify the column names with the table names.
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