SAS Chapter 13: Creating Samples And Indexes

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Moxleyv
M
Moxleyv
Community Contributor
Quizzes Created: 38 | Total Attempts: 21,992
| Attempts: 124 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. An index

Explanation

An index is a separate file from a data set that contains information about observations within the data set. Specifically, an index contains value/identifier pairs that indicate the location of observations within the data set and the value of one or more key variables in that observation.

Submit
Please wait...
About This Quiz
SAS Chapter 13: Creating Samples And Indexes - Quiz

Explore key SAS functionalities in 'SAS Chapter 13: Creating Samples and Indexes'. This quiz assesses your ability to manipulate data sets using sampling techniques and indexes, crucial for efficient data management and analysis in SAS programming.

Personalize your quiz and earn a certificate with your name on it!
2. Which of the following correctly creates a simple index named Origin on the Revenue data set?

Explanation

You use the CREATE INDEX statement of the SQL procedure to create an index on an existing data set. In the SQL procedure, you must name the index in the CREATE INDEX statement; for a simple index, the index name must match the name of the key variable.

Submit
3. To create an index on an existing data set, you use

Explanation

You can use the DATASETS procedure or the SQL procedure to create an index on or delete an index from an existing data set. You can also rebuild the index with a DATA step and use the INDEX= option to create an index on the rebuilt data set. However, rebuilding a data set uses more system resources than adding an index to an existing data set with either the DATASETS or the SQL procedure.

Submit
4. Which of the following expressions will generate a random integer between 1 and 50?

Explanation

In order to create a random sample of a data set, you need to generate a random integer. You can use the RANUNI function in conjunction with the CEIL function to create a random integer. You can use a multiplier with the RANUNI function to increase the range from which the random number is chosen to include as many numbers as you need.

Submit
5. Which of the following correctly creates a data set named Flights from the Sasuser.Revenue data set, creates a composite index namedFromto that is based on the values of Origin and Dest, and prints informational messages about the index to the SAS log?

Explanation

To create an index at the same time that you create a data set, you use the INDEX= option in the DATA statement. You must assign a unique name to a composite index, while a simple index is automatically assigned the name of the key variable as its name. You can set the value of the MSGLEVEL= system option to I in order to see messages about indexes in the SAS log.

Submit
6. Which of the following is true?

Explanation

For many maintenance tasks that you perform on a data set, SAS automatically performs corresponding tasks to the index file. For example, if you delete a data set, the index file is deleted as well. If you rename a data set with the CHANGE statement in the DATASETS procedure, SAS automatically renames the index file. If you copy a data set to a new location with the COPY statement in the DATASETS procedure, SAS automatically reconstructs the index file in the new location.

Submit
7. The variable that is created by the POINT= option is assigned a value

Explanation

The POINT= option in the SET statement names a variable. You must use program statements to assign a value to this variable during execution of the DATA step, before execution of the SET statement. Also, the value of the POINT= variable should be a number that corresponds to an observation number in the input data set, and it should be different each time the SET statement executes.

Submit
8. Which of the following programs correctly creates a systematic sample from a data set with an unknown number of observations and outputs these sample observations to a data set named Sample?

Explanation

To create a systematic sample from a data set that has an unknown number of observations, you use the NOBS= option in conjunction with the POINT= option in the SET statement. The NOBS= variable is automatically assigned a value of the total number of observations in the input data set, and you must assign a value to the POINT= variable before the SET statement executes.

Submit
9. To view a list of the indexes that are associated with a data set, you use

Explanation

You can use either the CONTENTS procedure or the CONTENTS statement in the DATASETS procedure to generate a list of information about a data set, including a list of existing indexes. All indexes for a data set are stored in a single file that is separate from but has the same name as the data set.

Submit
10. Suppose that the Sasuser.Revenue data set has a simple index named FlightID. For which of the following programs will the index be used?

Explanation

An index can improve the efficiency with which SAS is able to access certain observations in a data set. However, an index is not always useful. SAS will not use an index to process subsetting IF statements, or other statements that SAS determines might be more efficiently processed without an index.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 14, 2024 +

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

  • Current Version
  • Mar 14, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 26, 2013
    Quiz Created by
    Moxleyv
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
An index
Which of the following correctly creates a simple index...
To create an index on an existing data set, you use
Which of the following expressions will generate a random integer...
Which of the following correctly creates a data set...
Which of the following is true?
The variable that is created by the POINT= option is assigned a value
Which of the following programs correctly creates a systematic sample...
To view a list of the indexes that are associated with a data set, you...
Suppose that the Sasuser.Revenue data set has a simple index...
Alert!

Advertisement