InterviewSolution
Saved Bookmarks
| 1. |
State the difference between using the drop = data set option in the set statement and data statement. |
|
Answer» In SAS, the drop= option is used to exclude variables from processing or from the OUTPUT data set. This option tells SAS which variables you wish to remove from a data set.
Syntax: DROP=variable(s); In this case, variable(s) lists one or more names of variables. Variables can be listed in any format SAS supports. Example: Consider the following data set: DATA outdata; INPUT GENDER $ section score1 score2; DATALINES; F A 17 20 F B 25 17 F C 12 15 M D 21 25 ; proc print; run;The following DROP= data set option command SAS to drop variables score1 and score2. data READIN; set outdata (drop = score1 score2); TOTALSUM = sum(score1, score2); run;Output: Gender Section score1 score2 totalsum F A . . . F B . . . F C . . . M D . . . |
|