00001	!								&
	!			K I L L T E R M				&
	!								$
00010	ON ERROR GOTO 9000
00020	MAP (JPIBUF)		JPIINFO$=194%
	MAP (JPIBUF)	LONG	PID, PPGCNT, GPGCNT, CPUTIM, OWNER,	&
				STS, GRP, MEM, STATE, PRI, EFWM,	&
			STRING	TERM=6%, USERNAME=12%,			&
				IMAGNAME=128%, 	ACCOUNT=8%

00025	MAP (STRINGS)	PID$ = 8
00030	EXTERNAL INTEGER CONSTANT	SS$_NOMOREPROC,			&
					SS$_SUSPENDED,			&
					JPI$_PID,			&
					JPI$_GRP,			&
					JPI$_MEM,			&
					JPI$_TERMINAL,			&
					JPI$_USERNAME

00035	EXTERNAL INTEGER FUNCTION	SYS$FAO,			&
					SYS$GETJPIW,			&
					SYS$DELPRC

00040	DECLARE LONG CONSTANT HI_WORD=65536%

00045	DIM LONG JPILIST(15%), WORD IOSB(3%)

00048	INPUT "Terminal Line To Check "; CHECK_IT$			&
\	GOTO 32767 IF CHECK_IT$ = ""					&
\	CHECK_IT$ = EDIT$(CHECK_IT$,34%)	! Uppercase, Remove <SP>
00050	JPILIST(0%) = 4% + (HI_WORD * JPI$_PID)
	Z% = LOC(PID)
	JPILIST(1%) = Z%
	JPILIST(2%) = 0%

00055	JPILIST(3%) = 2% + (HI_WORD * JPI$_GRP)
	Z% = LOC(GRP)
	JPILIST(4%) = Z%
	JPILIST(5%) = 0%

00060	JPILIST(6%) = 2% + (HI_WORD * JPI$_MEM)
	Z% = LOC(MEM)
	JPILIST(7%) = Z%
	JPILIST(8%) = 0%

00065	JPILIST(9%) = 6% + (HI_WORD * JPI$_TERMINAL)
	Z% = LOC(TERM)
	JPILIST(10%) = Z%
	JPILIST(11%) = 0%

00070	JPILIST(12%) = 12% + (HI_WORD * JPI$_USERNAME)
	Z% = LOC(USERNAME)
	JPILIST(13%) = Z%
	JPILIST(14%) = 0%

00075	JPILIST(15%) = 0%

00080	PIX% = -1%

00100	JPILIST(0%) = 4% + (HI_WORD * JPI$_PID)

00105	Z% = SYS$GETJPIW(,PIX%,,JPILIST() BY REF,IOSB() BY REF,,)
	IF	Z% <> 1%
	THEN	GOTO 298	IF Z% = SS$_NOMOREPROC
		GOTO 100	IF JPILIST(0%) = 0%
		JPILIST(0%) = 0%
		GOTO 100	IF Z% = SS$_SUSPENDED
		E$ = ERT$(Z%)
		GOTO 32590

00110	IF	IOSB(0%) <> 1%
		THEN
		E$ = ERT$(Z%)
		GOTO 32590

00120	IF	ASCII(USERNAME) = 0% !* OR ASCII(ACCOUNT) <= 32%
	THEN	GOTO 100

00124	CALL SYS$FAO("!XL",,PID$,PID BY VALUE)
00130	IF LEFT(TERM,LEN(CHECK_IT$)) = CHECK_IT$
		THEN
		PRINT TERM,PID$
		Z% = SYS$DELPRC(PID,)
		
00198	GOTO 100

00298	GOTO 32767
08999	!								&
	!		E R R O R   T R A P S				&
	!								$
09000	RESUME 32500
09098	RESUME 32500
32499	!								&
	!		E R R O R   M E S S A G E S			&
	!								$
32500	E% = ERR							&
\	E$ = ERT$(E%)							&
\	E$ = E$ + " on line" + NUM$(ERL)
32590	PRINT								&
\	PRINT "**************************************************"	&
\	PRINT "*                                                *"	&
\	PRINT "*                  JOB ABORTED                   *"	&
\	PRINT "*                                                *"	&
\	PRINT "*"; E$; TAB(49%);                               "*"	&
\	PRINT "*                                                *"	&
\	PRINT "**************************************************"
32767	END
