Previous Page | Next Page

Starting with SAS Data Sets

Review of SAS Tools


Data Set Options

DROP=variable(s)

specifies the variables to be excluded.

Used in the SET statement, DROP= specifies the variables that are not to be read from the existing SAS data set into the program data vector. Used in the DATA statement, DROP= specifies the variables to be excluded from the data set that is being created.

FIRSTOBS=n

specifies the first observation to be read from the SAS data set that you specify in the SET statement.

KEEP=variable(s)

specifies the variables to be included.

Used in the SET statement, KEEP= specifies the variables to be read from the existing SAS data set into the program data vector. Used in the DATA statement, KEEP= specifies which variables in the program data vector are to be written to the data set being created.

OBS=n

specifies the last observation to be read from the SAS data set that you specify in the SET statement.


Procedures

PROC DATASETS <LIBRARY=SAS-data-library>;
CONTENTS <DATA=SAS-data set>;

describes the structure of a SAS data set, including the name, type, and length of all variables in the data set.


Statements

DATA SAS-data-set<(data-set-options)>;

begins a DATA step and names the SAS data set or data sets that are being created. You can specify the DROP= or KEEP= data set options in parentheses after each data set name to control which variables are written to the output data set from the program data vector.

DROP variable(s);

specifies the variables to be excluded from the data set that is being created. See also the DROP= data set option.

KEEP variable(s)

specifies the variables to be written to the data set that is being created. See also the KEEP= data set option.

SET SAS-data-set(data-set-options);

reads observations from a SAS data set rather than records of raw data. You can specify the DROP= or KEEP= data set options in parentheses after a data set name to control which variables are read into the program data vector from the input data set.

Previous Page | Next Page | Top of Page