Chapter Contents

Previous

Next
LIST

LIST



Writes to the SAS log the input data records for the observation that is being processed

Valid: in a DATA step
Category: Action
Type: Executable


Syntax
Without Arguments
Details
Comparisons
Examples
See Also

Syntax

LIST;

Without Arguments

The LIST statement causes the input data records for the observation being processed to be written to the SAS log.


Details

The LIST statement operates only on data that are read with an INPUT statement; it has no effect on data that are read with a SET, MERGE, MODIFY, or UPDATE statement.

In the SAS log, a ruler that indicates column positions appears before the first record listed.


Comparisons

Action LIST statement PUT statement
Writes when at the end of each iteration of the DATA step immediately
Writes what the input data records exactly as they appear the variables or literals specified
Writes where only to the SAS log to the SAS log, the SAS output destination, or to any external file
Works with INPUT statement only any data-reading statement
Handles Hex Values automatically prints a hexadecimal value if it encounters an unprintable character represents characters in hexadecimal only when a hex format is given


Examples

This example uses the LIST statement to write to the SAS log any input records that contain missing data.

data employee;
   input ssn 1-9 #3 w2amt 1-6;
   if w2amt=. then list;
   datalines;
23456789
JAMES SMITH
356.79
345671234
Jeffrey Thomas
.
;

Because of the #3 line pointer control in the INPUT statement, SAS reads three input records to create a single observation. Therefore, the LIST statement writes the three current input records to the SAS log each time a value for W2AMT is missing:

     
RULE:----+----1----+----2----+----3----+----4----+----5----+----
9  345671234
10  Jeffrey Thomas
11  .

The numbers 9, 10, and 11 are line numbers in the SAS log.

See Also

Statement:

PUT


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.