XUTMTD ;SEA/RDS - TaskMan: ToolKit, Delete ;12/30/94 11:17
;;8.0;KERNEL;;Jul 10, 1995
;Call with XUTMT as task number
L +^%ZTSK(XUTMT)
N ZTSK S ZTSK=XUTMT D UNSCH^%ZTLOAD6
D DELETE
L -^%ZTSK(XUTMT)
Q
;
DELETE ;Delete Task
K:'$D(^%ZTSCH("TASK",XUTMT)) ^%ZTSK(XUTMT)
Q
;
UNSCHED ;Replased by call to UNSCH^%ZTLOAD6
N ZT,ZT1,ZT2,ZT3
S ZT1=0 F S ZT1=$O(^%ZTSCH(ZT1)) Q:'ZT1 I $D(^(ZT1,XUTMT))#2 D
. L +^%ZTSCH(ZT1,XUTMT) K ^(XUTMT) L -^%ZTSCH(ZT1,XUTMT)
L +^%ZTSCH("IO")
S ZT1="" F S ZT1=$O(^%ZTSCH("IO",ZT1)),ZT2="" Q:ZT1="" F S ZT2=$O(^%ZTSCH("IO",ZT1,ZT2)) Q:ZT2="" D DQIO:$D(^(ZT2,XUTMT))#2
L -^%ZTSCH("IO"),+^%ZTSCH("JOB")
S ZT1="" F S ZT1=$O(^%ZTSCH("JOB",ZT1)) Q:ZT1="" I $D(^(ZT1,XUTMT))#2 K ^(XUTMT)
L -^%ZTSCH("JOB"),+^%ZTSCH("LINK")
S ZT1="" F S ZT1=$O(^%ZTSCH("LINK",ZT1)),ZT2="" Q:ZT1="" F S ZT2=$O(^%ZTSCH("LINK",ZT1,ZT2)) Q:ZT2="" I $D(^(ZT2,XUTMT))#2 K ^(XUTMT)
L -^%ZTSCH("LINK"),+^%ZTSCH("C")
S ZT1="" F S ZT1=$O(^%ZTSCH("C",ZT1)),ZT2="" Q:ZT1="" F S ZT2=$O(^%ZTSCH("C",ZT1,ZT2)) Q:ZT2="" I $D(^(ZT2,XUTMT))#2 K ^(XUTMT)
L -^%ZTSCH("C")
Q
;
DQIO ;Remove A Device Waiting List Entry
N %ZTIO,ZTDTH,ZTSK S %ZTIO=ZT1,ZTDTH=ZT2,ZTSK=XUTMT
D DQ^%ZTM4 Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXUTMTD 1240 printed Dec 13, 2024@02:13:43 Page 2
XUTMTD ;SEA/RDS - TaskMan: ToolKit, Delete ;12/30/94 11:17
+1 ;;8.0;KERNEL;;Jul 10, 1995
+2 ;Call with XUTMT as task number
+3 LOCK +^%ZTSK(XUTMT)
+4 NEW ZTSK
SET ZTSK=XUTMT
DO UNSCH^%ZTLOAD6
+5 DO DELETE
+6 LOCK -^%ZTSK(XUTMT)
+7 QUIT
+8 ;
DELETE ;Delete Task
+1 if '$DATA(^%ZTSCH("TASK",XUTMT))
KILL ^%ZTSK(XUTMT)
+2 QUIT
+3 ;
UNSCHED ;Replased by call to UNSCH^%ZTLOAD6
+1 NEW ZT,ZT1,ZT2,ZT3
+2 SET ZT1=0
FOR
SET ZT1=$ORDER(^%ZTSCH(ZT1))
if 'ZT1
QUIT
IF $DATA(^(ZT1,XUTMT))#2
Begin DoDot:1
+3 LOCK +^%ZTSCH(ZT1,XUTMT)
KILL ^(XUTMT)
LOCK -^%ZTSCH(ZT1,XUTMT)
End DoDot:1
+4 LOCK +^%ZTSCH("IO")
+5 SET ZT1=""
FOR
SET ZT1=$ORDER(^%ZTSCH("IO",ZT1))
SET ZT2=""
if ZT1=""
QUIT
FOR
SET ZT2=$ORDER(^%ZTSCH("IO",ZT1,ZT2))
if ZT2=""
QUIT
if $DATA(^(ZT2,XUTMT))#2
DO DQIO
+6 LOCK -^%ZTSCH("IO"),+^%ZTSCH("JOB")
+7 SET ZT1=""
FOR
SET ZT1=$ORDER(^%ZTSCH("JOB",ZT1))
if ZT1=""
QUIT
IF $DATA(^(ZT1,XUTMT))#2
KILL ^(XUTMT)
+8 LOCK -^%ZTSCH("JOB"),+^%ZTSCH("LINK")
+9 SET ZT1=""
FOR
SET ZT1=$ORDER(^%ZTSCH("LINK",ZT1))
SET ZT2=""
if ZT1=""
QUIT
FOR
SET ZT2=$ORDER(^%ZTSCH("LINK",ZT1,ZT2))
if ZT2=""
QUIT
IF $DATA(^(ZT2,XUTMT))#2
KILL ^(XUTMT)
+10 LOCK -^%ZTSCH("LINK"),+^%ZTSCH("C")
+11 SET ZT1=""
FOR
SET ZT1=$ORDER(^%ZTSCH("C",ZT1))
SET ZT2=""
if ZT1=""
QUIT
FOR
SET ZT2=$ORDER(^%ZTSCH("C",ZT1,ZT2))
if ZT2=""
QUIT
IF $DATA(^(ZT2,XUTMT))#2
KILL ^(XUTMT)
+12 LOCK -^%ZTSCH("C")
+13 QUIT
+14 ;
DQIO ;Remove A Device Waiting List Entry
+1 NEW %ZTIO,ZTDTH,ZTSK
SET %ZTIO=ZT1
SET ZTDTH=ZT2
SET ZTSK=XUTMT
+2 DO DQ^%ZTM4
QUIT
+3 ;