SAS
Know Your SAS Dataset Options: A Quiz Challenge
Test your SAS dataset options proficiency with the "Mastering Dataset Options in SAS Quiz." The quiz includes multiple-choice questions, true/false questions, and a coding challenge with explanations. You'll get 1 point per correct answer, with a maximum score of 100%. There are 7 questions and no time limit. Good luck!
Before diving into the ultimate SAS Libraries quiz, we'd like you to log in. Why? Because we believe your progress is worth tracking and your achievements are worth celebrating!
Rest assured, your data is kept confidential and secure. By logging in, you agree to our terms of use and privacy policy.
👇 Unlock a world of SAS wisdom by providing your Name, Email, and Country.
1 / 7
data new_dataset(keep=age fullname); set old_dataset(drop=salary rename=(fullname=name)); run;
Is the above SAS code correct for achieving the following objectives?
The code is incorrect because it attempts to both keep and rename the variable name in the new dataset new_dataset. Specifically, the keep=age name option in the DATA statement specifies that only the age and name variables should be kept in new_dataset. However, the rename=(fullname=name) option in the SET statement tries to rename the fullname variable from old_dataset to name.
name
new_dataset
keep=age name
age
rename=(fullname=name)
fullname
old_dataset
The conflict arises because the name variable is not initially present in old_dataset (it's supposed to be renamed from fullname). Therefore, the keep=age name option in the DATA statement will not find a name variable to keep, leading to confusion.
To correct this, you could either:
keep=age fullname
2 / 7
Which of the following options can be used to specify the number of the first observation to be read?
The FIRSTOBS option specifies the number of the first observation to be read.
FIRSTOBS
3 / 7
The KEEP statement affects the Program Data Vector (PDV).
The KEEP statement does not affect the PDV. It only applies to the new data set.
4 / 7
Which data set option prevents the replacement of a permanent data set?
The REPLACE=NO option prevents the replacement of a permanent data set.This data set option overrides the system option of the same name. REPLACE=YES is the default.
REPLACE=NO
5 / 7
Which dataset option is used to set a password for altering a dataset?
The ALTER option is used to set a password that allows altering the dataset. Refer to our article on How to Password Protect SAS Datasets?. for more details.
ALTER
6 / 7
What does the DATASTMTCHK system option do?
The DATASTMTCHK system option prevents datasets from being created with names like SET and MERGE.
7 / 7
What does the KEEP data set option do in SAS?
The KEEP data set option keeps only the specified variables in the new data set.
Your score is
The average score is 54%
Restart quiz
Thank you for your Feedback