ZU ;SF/RWF - For Open M for NT and Cache! ;03/21/2002 13:46
;;8.0;KERNEL;**34,94,118,162,170,225**;Jul 10, 1995
;TIE ALL TERMINALS EXCEPT CONSOLE TO THIS ROUTINE!
EN N $ES,$ETRAP S $ETRAP="D ERR^ZU Q"
D:+$G(^%ZTSCH("LOGRSRC")) LOGRSRC^%ZOSV("$LOGIN$")
;The next line keeps sign-on users from taking the last slot
;It can be commented out if not needed.
JOBCHK I $$AVJ^%ZOSV()<3 W $C(7),!!,"** TROUBLE ** - ** CALL IRM NOW! **" G HALT
;Only call ShareLic for Telnet connections.
I ($I["|TNT|")!($I["TNA") D SHARELIC^%ZOSV(0)
G ^XUS
;
;
ERR ;Come here on error
I $ZE["STACK" S $ET="Q:$ST>"_($ST-8)_" D ERR2^ZU" Q
ERR2 S $ET="UNWIND^ZU" L ;Backup trap
Q:$ECODE["<PROG>"
D ^%ZTER
I $G(IO)]"",$D(IO(1,IO)),$E($G(IOST))="P" U IO W @$S($D(IOF):IOF,1:"#")
I $G(IO(0))]"" U IO(0) W !!,"RECORDING THAT AN ERROR OCCURRED ---",!!?15,"Sorry 'bout that",!,*7,!?10,"$ZERROR=",$ZERROR
X ^%ZOSF("PROGMODE") Q:Y S $ZT="HALT^ZU"
I $ZE'["<INRPT>" S XUERF="" G ^XUSCLEAN
CTRLC I $D(IO)=11 U IO(0) W !,"--Interrupt Acknowledged",!
D KILL1^XUSCLEAN ;Clean up symbol table
S $ECODE=",U55,"
Q
;
UNWIND ;Unwind the stack
Q:$ES>1 G CTRLC2:$EC["U55"
S $EC=""
Q
;
CTRLC2 S $EC="" G:$G(^XUTL("XQ",$J,"T"))<2 ^XUSCLEAN
S ^XUTL("XQ",$J,"T")=1,XQY=^(1),XQY0=$P(XQY,"^",2,99)
G:$P(XQY0,"^",4)'="M" CTRLC2
S XQPSM=$P(XQY,"^",1),XQY=+XQPSM,XQPSM=$P(XQPSM,XQY,2,3)
G:'XQY ^XUSCLEAN
S $ECODE="",$ETRAP="D ERR^ZU" G M1^XQ
;
HALT S $EC="" I $D(^XUTL("XQ",$J)) D BYE^XUSCLEAN
D:+$G(^%ZTSCH("LOGRSRC")) LOGRSRC^%ZOSV("$LOGOUT$")
HALT
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HZU 1576 printed Oct 16, 2024@18:17:25 Page 2
ZU ;SF/RWF - For Open M for NT and Cache! ;03/21/2002 13:46
+1 ;;8.0;KERNEL;**34,94,118,162,170,225**;Jul 10, 1995
+2 ;TIE ALL TERMINALS EXCEPT CONSOLE TO THIS ROUTINE!
EN NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^ZU Q"
+1 if +$GET(^%ZTSCH("LOGRSRC"))
DO LOGRSRC^%ZOSV("$LOGIN$")
+2 ;The next line keeps sign-on users from taking the last slot
+3 ;It can be commented out if not needed.
JOBCHK IF $$AVJ^%ZOSV()<3
WRITE $CHAR(7),!!,"** TROUBLE ** - ** CALL IRM NOW! **"
GOTO HALT
+1 ;Only call ShareLic for Telnet connections.
+2 IF ($IO["|TNT|")!($IO["TNA")
DO SHARELIC^%ZOSV(0)
+3 GOTO ^XUS
+4 ;
+5 ;
ERR ;Come here on error
+1 IF $ZE["STACK"
SET $ETRAP="Q:$ST>"_($STACK-8)_" D ERR2^ZU"
QUIT
ERR2 ;Backup trap
SET $ETRAP="UNWIND^ZU"
LOCK
+1 if $ECODE["<PROG>"
QUIT
+2 DO ^%ZTER
+3 IF $GET(IO)]""
IF $DATA(IO(1,IO))
IF $EXTRACT($GET(IOST))="P"
USE IO
WRITE @$SELECT($DATA(IOF):IOF,1:"#")
+4 IF $GET(IO(0))]""
USE IO(0)
WRITE !!,"RECORDING THAT AN ERROR OCCURRED ---",!!?15,"Sorry 'bout that",!,*7,!?10,"$ZERROR=",$ZERROR
+5 XECUTE ^%ZOSF("PROGMODE")
if Y
QUIT
SET $ZT="HALT^ZU"
+6 IF $ZE'["<INRPT>"
SET XUERF=""
GOTO ^XUSCLEAN
CTRLC IF $DATA(IO)=11
USE IO(0)
WRITE !,"--Interrupt Acknowledged",!
+1 ;Clean up symbol table
DO KILL1^XUSCLEAN
+2 SET $ECODE=",U55,"
+3 QUIT
+4 ;
UNWIND ;Unwind the stack
+1 if $ESTACK>1
QUIT
if $ECODE["U55"
GOTO CTRLC2
+2 SET $ECODE=""
+3 QUIT
+4 ;
CTRLC2 SET $ECODE=""
if $GET(^XUTL("XQ",$JOB,"T"))<2
GOTO ^XUSCLEAN
+1 SET ^XUTL("XQ",$JOB,"T")=1
SET XQY=^(1)
SET XQY0=$PIECE(XQY,"^",2,99)
+2 if $PIECE(XQY0,"^",4)'="M"
GOTO CTRLC2
+3 SET XQPSM=$PIECE(XQY,"^",1)
SET XQY=+XQPSM
SET XQPSM=$PIECE(XQPSM,XQY,2,3)
+4 if 'XQY
GOTO ^XUSCLEAN
+5 SET $ECODE=""
SET $ETRAP="D ERR^ZU"
GOTO M1^XQ
+6 ;
HALT SET $ECODE=""
IF $DATA(^XUTL("XQ",$JOB))
DO BYE^XUSCLEAN
+1 if +$GET(^%ZTSCH("LOGRSRC"))
DO LOGRSRC^%ZOSV("$LOGOUT$")
+2 HALT
+3 ;