Displays lines that are entered in the current session
Valid: anywhere
Category: Program Control
%LIST < n <: m “ m >>;
In interactive line mode processing, if you use the %LIST statement without arguments, it displays all previously entered program lines.
n
displays line n .
n “m
displays lines n through m .
Alias: n:m
Where and When to Use The %LIST statement can be used anywhere in a SAS job except between a DATALINES or DATALINES4 statement and the matching semicolon (;) or semicolons (;;;;). This statement is useful mainly in interactive line mode sessions to display SAS program code on the monitor. It is also useful to determine lines to include when you use the %INCLUDE statement.
Interactions
CAUTION:
In all modes of execution, the SPOOL system option controls whether SAS statements are saved.
When the SPOOL system option is in effect in interactive line mode, all SAS statements and data lines are saved automatically when they are submitted. You can display them by using the %LIST statement. When NOSPOOL is in effect, %LIST cannot display previous lines.
This %LIST statement displays lines 10 through 20:
%list 10-20;
Statement:
%INCLUDE Statement on page 1215
System Option:
SPOOL System Option on page 1604