Some SAS procedures
are interactive, which means they remain active until you submit a
QUIT statement, or until you submit a new PROC or DATA step. In SAS
Studio, you can use the code editor to run these procedures, as well
as other SAS procedures, in interactive mode.
By using interactive
mode, you can run selected lines of code from your SAS program and
use the results to determine your next steps. For example, the OPTMODEL
procedure in
SAS/OR enables you to model and solve mathematical programming
models. By running this procedure interactively, you can quickly check
results for parts of the program and determine whether you need to
make any modifications without running the entire program.
Note: Interactive mode is available
only if you are running the first maintenance release for SAS 9.4.
To run a program in
interactive mode, click
on the toolbar. To turn off interactive mode, click
again. If you change modes while a program is open,
the log and results for that program are cleared. You can also clear
the log and results manually by clicking
on the appropriate toolbar.
Note: If you create a new library
when you are in interactive mode, the library might not be available
when you turn off interactive mode. If you want the library to be
available in both interactive and noninteractive modes, you can assign
the library again in noninteractive mode, or you can add the library
assignment to your autoexec.sas file.
For more information,
see Editing the Autoexec File.
When you run a program
in interactive mode, SAS Studio does not add any automatically generated
code, such as ODS and %LET statements, to your program. In addition,
results are generated only in HTML. In interactive mode, the log and
results are appended to the existing log and results. Previously submitted
code remains active until you terminate it.
For example, suppose
you have the following program:
proc sql;
select * from sashelp.cars;
select * from sashelp.class;
quit;
In noninteractive mode,
if you select the first two lines of code and submit them, the code
runs successfully. If you then select the last two lines of code and
submit them, the code fails because the PROC SQL statement is missing.
If you switch to interactive
mode and follow the same steps, the last two lines of code run successfully
because the PROC SQL statement is still active.
Note: For documentation about specific
procedures, see the SAS Programmer’s Bookshelf on support.sas.com.