|SAS Companion for UNIX Environments|
There are three ways to interrupt or terminate your SAS session:
killcommand sends an interrupt or quit signal to the SAS System, depending on which signal you specify. You can use the
killcommand to interrupt or terminate a SAS session running in any mode.
killcommand. However, they can be used only when your SAS program is running in interactive line mode or in batch mode in the foreground. You cannot use control keys to stop a batch job that has been submitted with the
|Using the kill Command|
kill command cannot
be issued from within a SAS session. You must issue it from another terminal
or from another window (if your terminal permits it).
The format of the
kill command is
|kill <-signal-name> pid|
-SIGINT; to send the quit signal, specify
-SIGQUIT. Use the
pscommand to determine the process identification number (pid) of the SAS session that you want to interrupt or terminate.
For example, suppose you want to stop a SAS job running
in the background. First, issue the
ps command to determine the PID of the SAS job.
> ps PID TTY TIME COMMAND 2103 ttyu0 0:00 motifxsa 2111 ttyu0 0:01 sas 2116 ttyu0 0:00 ps 3856 ttyu2 0:03 kshFour PIDs appear, but only one is for a SAS program. (
motifxsais the SAS session manager. See Using the SAS Session Manager (motifxsassm) for more information.) Therefore, to send the interrupt signal to that SAS program, you would issue this command:
kill -SIGINT 2111The SAS System replies with a prompt:
Press Y to cancel submitted statements, N to continue.
For more information, refer to the UNIX man pages for
|Using Control Keys|
Control keys enable you to interrupt or terminate your session by simply pressing the interrupt or quit key sequence. However, control keys can be used only when your SAS program is running in interactive line mode or in batch mode in the foreground. You cannot use control keys to stop a background job.
Because control keys vary from system to system, issue
stty command to
determine which key sends which signal. The
stty command varies considerably among UNIX operating environments,
so check the
man page before using it. Usually, one of these forms of the command will
print all of the current terminal settings:
stty stty -a stty everythingThe output you see should contain lines similar to these:
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = ^@
The caret (^) stands for the CTRL key. In this example, control-C is the interrupt key and control-\ is the quit key.
|Using the Session Manager|
If you invoke SAS in the windowing environment, you can use the session manager to interrupt or terminate your SAS session. The session manager is automatically iconified when you start SAS. To interrupt or terminate your SAS session, open the session manager window and press [Interrupt] or [Terminate].
Top of Page
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.