SAS Chapter 22: Using Best Practices

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Moxleyv
M
Moxleyv
Community Contributor
Quizzes Created: 38 | Total Attempts: 20,578
Questions: 5 | Attempts: 99

SettingsSettingsSettings
SAS Chapter 22: Using Best Practices - Quiz


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.

    Correct Answer
    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.
    Explanation
    As SAS processes a larger subset of the data, more CPU resources are required. However, positioning of the subsetting IF statement in a DATA step does affect performance and efficiency.

    Rate this question:

  • 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.

    Correct Answer
    C. You can use the DATA step to modify both data values and variable attributes.
    Explanation
    The DATA step is the only technique that can be used to modify both data values and variable attributes. The DATASETS procedure enables you to modify only variable attributes.

    Rate this question:

  • 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.

    Correct Answer
    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.
    Explanation
    For selecting observations, a WHERE statement is more efficient than a subsetting IF statement 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.

    Rate this question:

  • 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.

    Correct Answer
    A. When the external file on which the data set is based might change between SAS sessions.
    Explanation
    It is more advantageous to create a temporary SAS data set rather than a permanent SAS data set when the external file on which the data set is based is frequently updated between SAS sessions.

    Rate this question:

  • 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.

    Correct Answer
    C. A one-step DATASETS procedure results in a decrease in CPU usage.
    Explanation
    A one-step DATASETS procedure results in a savings of CPU usage and I/O operations. PROC DATASETS supports RUN-group processing, which enables you to process multiple SAS data sets from the same library with one invocation of the procedure.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Dec 06, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 10, 2013
    Quiz Created by
    Moxleyv

Related Topics

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.