![]() Chapter Contents |
![]() Previous |
![]() Next |
| SAS Companion for UNIX Environments |
There are three ways to interrupt or terminate your SAS session:
kill command.kill command sends an interrupt or quit signal to the SAS System, depending
on which signal you specify. You can use the
kill command to interrupt or terminate a SAS session running in any
mode.kill command. 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
batch,
at,
nohup, or
cron command.| Using the kill Command |
The
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
ps
command 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 ksh
Four PIDs appear, but only one is for a SAS
program. (
motifxsa is
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
the
ps and
kill commands.
| Using Control Keys |
Because control keys vary from system to system, issue
the UNIX
stty command to
determine which key sends which signal. The
stty command varies considerably among UNIX operating environments,
so check the
stty UNIX
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 |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.