LIST Statement

LIST <range> <VAR operand> <WHERE(expression)> ;

The LIST statement displays observations of a data set. The arguments to the LIST statement are as follows:

range

specifies a range of observations. You can specify a range of observations by using the ALL, CURRENT, NEXT, AFTER, and POINT keywords, as described in the section Process a Range of Observations.

operand

specifies a set of variables. As described in the section Select Variables with the VAR Clause, you can specify variable names by using a matrix literal, a character matrix, an expression, or the _ALL_, _CHAR_, or _NUM_ keywords.

expression

specifies observations to list. If you omit the WHERE clause, all observations are listed. For details about the WHERE clause, see the section Process Data by Using the WHERE Clause.

The LIST statement displays selected observations of a data set. If all data values for variables in the VAR clause fit on a single line, values are displayed in columns headed by the variable names. Each record occupies a separate line. If the data values do not fit on a single line, values from each record are grouped into paragraphs. Each element in the paragraph has the form name=value.

The following examples demonstrate the use of the LIST statement. The output is not shown.

use Sashelp.Class;

list all;                               /* lists whole data set */
list;                              /* lists current observation */
list var{name age};        /* lists NAME and AGE in current obs */
list all where(age<=13); /* lists all obs where condition holds */
list next;                            /* lists next observation */
list point 18;                          /* lists observation 18 */
list point (10:15);         /* lists observations 10 through 15 */

close Sashelp.Class;