Working with SAS Data Sets


Edit a SAS Data Set

You can edit a SAS data set by using the EDIT statement . You can update values of variables, mark observations for deletion, delete the marked observations, and save your changes. The general form of the EDIT statement is as follows:

  • EDIT SAS-data-set <VAR operand> <WHERE(expression)> ;

where

SAS-data-set

names an existing SAS data set.

operand

selects a set of variables. For details about the VAR clause, see the section Select Variables with the VAR Clause.

expression

is an expression that is evaluated as being true or false. For details about the WHERE clause, see the section Process Data by Using the WHERE Clause.

This section edits and deletes observations, so make a copy of the Sashelp.Class data set by running the following DATA step:

data Class;
set Sashelp.Class;
run;