The DROP Data Set Option
The DROP data set option is very similar to the KEEP data set option.
Instead of keeping the variables in the data set, the DROP option drops the variables from the data set.
Example
Data Class;
Set SASHelp.class (drop=name age sex);
Run;
The DROP data set option drops the NAME, AGE and SEX variables from the input SASHelp.class data set.
Only the HEIGHT and WEIGHT variables are left in the output:
✍️ Exam Tips
The KEEP and DROP options can be used within a single data step.
? Sample Exam Question(s):
Question 2
Question 2:
The answer is (a).
There are five variables kept in the input SASDATA.cities:
- orig
- dest
- city
- price
- equipment
The variables city, dest, equipment are dropped from the LABDATA.DALLAS data set.
Only the orig and price variables are output to both data sets.
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |