SAS Chapter 22: Using Best Practices

5 Questions | Total Attempts: 51

SettingsSettingsSettings
SAS Quizzes & Trivia

In our ongoing SAS quiz series, we turn our attention to the different practices and which is the best to use in a given situation. What do you know about IF statements, PROC DATASETS, WHERE statements and more?


Questions and Answers
  • 1. 
    Placing the subsetting IF statement at the top rather than near the bottom of a DATA step results in a savings in CPU usage. What happens if the subset is large rather than small?
    • A. 

      The savings in CPU usage increases as the subset grows larger because the I/O increases.

    • B. 

      The savings in CPU usage decreases as the subset grows larger. However, placing the subsetting IF statement at the top of a DATA step always uses fewer resources than placing it at the bottom.

    • C. 

      The savings in CPU usage remains constant as the subset grows larger. However, placing the subsetting IF statement near the bottom of a data set is preferable.

    • D. 

      The savings in CPU usage decreases as the subset grows larger. However, placing the subsetting IF statement near the bottom of a data set increases the I/O.

  • 2. 
    Which of the following statements is true about techniques that are used for modifying data and attributes?
    • A. 

      You can use PROC DATASETS to modify both data values and variable attributes.

    • B. 

      You can use PROC DATASETS to modify only data values.

    • C. 

      You can use the DATA step to modify both data values and variable attributes.

    • D. 

      You can use the DATA step to modify only variable attributes.

  • 3. 
    For selecting observations, is a subsetting IF statement or a WHERE statement more efficient? Why?
    • A. 

      A subsetting IF statement is more efficient because it loads all observations sequentially into the program data vector.

    • B. 

      A subsetting IF statement is more efficient because it examines what is in the input buffer and selects observations before they are loaded into the program data vector, which results in a savings in CPU operations.

    • C. 

      A WHERE statement is more efficient because it loads all observations sequentially into the program data vector.

    • D. 

      A WHERE statement is more efficient because it examines what is in the input buffer and selects observations before they are loaded into the program data vector, which results in a savings in CPU operations.

  • 4. 
    When is it more advantageous to create a temporary SAS data set rather than a permanent SAS data set?
    • A. 

      When the external file on which the data set is based might change between SAS sessions.

    • B. 

      When the external file on which the data set is based does not change between SAS sessions.

    • C. 

      When the data set is needed for more than one SAS session.

    • D. 

      When you are converting raw numeric values to SAS data values.

  • 5. 
    When you compare the technique of using multiple DATASETS procedures to using a single DATASETS procedure to modify the descriptor portion of a data set, which is true?
    • A. 

      A one-step DATASETS procedure results in an increase in I/O operations.

    • B. 

      Multiple DATASETS procedures result in a decrease in I/O operations.

    • C. 

      A one-step DATASETS procedure results in a decrease in CPU usage.

    • D. 

      Multiple DATASETS procedures result in a decrease in CPU usage.

Related Topics
Back to Top Back to top