XUTMQ3 ;SEA/RDS - TaskMan: Option, ZTMINQ, Part 5 (Modules) ;03/09/2000 12:58 [ 04/02/2003 8:29 AM ]
;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
;;8.0;KERNEL;**136**;Jul 10, 1995
;
ENTRY G ^XUTMQ
;
PRINT ;Subroutine--Print A Task
N ZTSK W:'ZTC @IOF,!,ZTH,! W:'ZTF !,"-------------------------------------------------------------------------------"
S X=0,ZTC=0,ZTF=0 D EN^XUTMTP(ZTS) I $Y>18 W ! S ZTF=1,DIR(0)="E" D ^DIR S X=$D(DTOUT)!$D(DUOUT) Q:X W @IOF
S ZTC=ZTC+1 Q
;
OUT ;Tag for breaking FOR scope to exit early
Q
;
IOQ0 ;IOQ--Extending Scope Of FOR Loop
S ZTS=ZT3 D PRINT Q:X
Q
;
IO ;IO1--List the tasks waiting for the selected device
S X=0,ZTC=0,ZTF=1,ZTH="Tasks waiting for device "_ZTION_"..."
S ZT2="" F ZT=0:0 S ZT2=$O(^%ZTSCH("IO",ZT1,ZT2)),ZT3="" Q:'ZT2 F ZT=0:0 S ZT3=$O(^%ZTSCH("IO",ZT1,ZT2,ZT3)) Q:ZT3="" S ZTS=ZT3 D PRINT G OUT:X
Q:X W:'ZTC !?5,"On this volume set there are no tasks waiting for that device." W ! Q
;
IOQ ;Tasks waiting for devices.
N DIR,DIRUT,DTOUT,DUOUT,X,ZT,ZT1,ZT2,ZT3,ZTC,ZTF,ZTH,ZTS S ZTC=0,ZTF=1,ZTH="Tasks waiting for devices..."
S ZT1="" F ZT=0:0 S ZT1=$O(^%ZTSCH("IO",ZT1)),ZT2="" Q:ZT1="" F ZT=0:0 S ZT2=$O(^%ZTSCH("IO",ZT1,ZT2)),ZT3="" Q:'ZT2 F ZT=0:0 S ZT3=$O(^%ZTSCH("IO",ZT1,ZT2,ZT3)) Q:ZT3="" D IOQ0 G OUT:X
I 'ZTC W !!,"There are no tasks waiting for devices on this volume set."
W ! S DIR(0)="E",DIR("A")=$S(ZTC:"End of listing. ",1:"")_"Press RETURN to continue" D ^DIR Q
;
IO1 ;Waiting list for a device
N DIR,DIRUT,DTOUT,DUOUT,X,ZT,ZT1,ZT2,ZT3,ZTC,ZTF,ZTIO,ZTION,ZTH,ZTS
F ZT=0:0 D IO2 Q:ZTION="" S ZT1=ZTIO D IO Q:X
Q
;
IO2 ;IO1--prompt user for a device
S DIR(0)="PO^3.5:EMQZ"
S DIR("A")="Select DEVICE"
S DIR("?",1)=" Answer should be a device whose waiting list you want to see."
S DIR("?")=" Enter ?? for a list of devices with waiting tasks."
S DIR("??")="^D IO3^XUTMQ3"
D ^DIR K DIR
I $D(DTOUT) W $C(7)
I $D(DIRUT) S ZTION="" Q
S ZTION=$P(Y,U,2),ZTIO=$P(Y(0),U,2)
Q
;
IO3 ;IO2--?? help for device selection
N ZT,ZT1,ZT2,ZT3,ZT4,ZTC
W !!?5,"These are the devices with waiting tasks:",!
S ZT1="IO",ZT2=""
F S ZT2=$O(^%ZTSCH("IO",ZT2)) Q:ZT2="" D IOCNT I ZTC W !?5,ZT2,?40,ZTC," task",$S(ZTC=1:"",1:"s")
Q
;
IOCNT ;IO3--count tasks waiting for each device
S ZT3="",ZTC=0
F S ZT3=$O(^%ZTSCH("IO",ZT2,ZT3)),ZT4="" Q:ZT3="" F S ZT4=$O(^%ZTSCH("IO",ZT2,ZT3,ZT4)) Q:ZT4="" S ZTC=ZTC+1
Q
;
XUTMQ3 ;SEA/RDS - TaskMan: Option, ZTMINQ, Part 5 (Modules) ;03/09/2000 12:58 [ 04/02/2003 8:29 AM ]
+1 ;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
+2 ;;8.0;KERNEL;**136**;Jul 10, 1995
+3 ;
ENTRY GOTO ^XUTMQ
+1 ;
PRINT ;Subroutine--Print A Task
+1 NEW ZTSK
IF 'ZTC
WRITE @IOF,!,ZTH,!
IF 'ZTF
WRITE !,"-------------------------------------------------------------------------------"
+2 SET X=0
SET ZTC=0
SET ZTF=0
DO EN^XUTMTP(ZTS)
IF $Y>18
WRITE !
SET ZTF=1
SET DIR(0)="E"
DO ^DIR
SET X=$DATA(DTOUT)!$DATA(DUOUT)
IF X
QUIT
WRITE @IOF
+3 SET ZTC=ZTC+1
QUIT
+4 ;
OUT ;Tag for breaking FOR scope to exit early
+1 QUIT
+2 ;
IOQ0 ;IOQ--Extending Scope Of FOR Loop
+1 SET ZTS=ZT3
DO PRINT
IF X
QUIT
+2 QUIT
+3 ;
IO ;IO1--List the tasks waiting for the selected device
+1 SET X=0
SET ZTC=0
SET ZTF=1
SET ZTH="Tasks waiting for device "_ZTION_"..."
+2 SET ZT2=""
FOR ZT=0:0
SET ZT2=$ORDER(^%ZTSCH("IO",ZT1,ZT2))
SET ZT3=""
IF 'ZT2
QUIT
FOR ZT=0:0
SET ZT3=$ORDER(^%ZTSCH("IO",ZT1,ZT2,ZT3))
IF ZT3=""
QUIT
SET ZTS=ZT3
DO PRINT
IF X
GOTO OUT
+3 IF X
QUIT
IF 'ZTC
WRITE !?5,"On this volume set there are no tasks waiting for that device."
WRITE !
QUIT
+4 ;
IOQ ;Tasks waiting for devices.
+1 NEW DIR,DIRUT,DTOUT,DUOUT,X,ZT,ZT1,ZT2,ZT3,ZTC,ZTF,ZTH,ZTS
SET ZTC=0
SET ZTF=1
SET ZTH="Tasks waiting for devices..."
+2 SET ZT1=""
FOR ZT=0:0
SET ZT1=$ORDER(^%ZTSCH("IO",ZT1))
SET ZT2=""
IF ZT1=""
QUIT
FOR ZT=0:0
SET ZT2=$ORDER(^%ZTSCH("IO",ZT1,ZT2))
SET ZT3=""
IF 'ZT2
QUIT
FOR ZT=0:0
SET ZT3=$ORDER(^%ZTSCH("IO",ZT1,ZT2,ZT3))
IF ZT3=""
QUIT
DO IOQ0
IF X
GOTO OUT
+3 IF 'ZTC
WRITE !!,"There are no tasks waiting for devices on this volume set."
+4 WRITE !
SET DIR(0)="E"
SET DIR("A")=$SELECT(ZTC:"End of listing. ",1:"")_"Press RETURN to continue"
DO ^DIR
QUIT
+5 ;
IO1 ;Waiting list for a device
+1 NEW DIR,DIRUT,DTOUT,DUOUT,X,ZT,ZT1,ZT2,ZT3,ZTC,ZTF,ZTIO,ZTION,ZTH,ZTS
+2 FOR ZT=0:0
DO IO2
IF ZTION=""
QUIT
SET ZT1=ZTIO
DO IO
IF X
QUIT
+3 QUIT
+4 ;
IO2 ;IO1--prompt user for a device
+1 SET DIR(0)="PO^3.5:EMQZ"
+2 SET DIR("A")="Select DEVICE"
+3 SET DIR("?",1)=" Answer should be a device whose waiting list you want to see."
+4 SET DIR("?")=" Enter ?? for a list of devices with waiting tasks."
+5 SET DIR("??")="^D IO3^XUTMQ3"
+6 DO ^DIR
KILL DIR
+7 IF $DATA(DTOUT)
WRITE $CHAR(7)
+8 IF $DATA(DIRUT)
SET ZTION=""
QUIT
+9 SET ZTION=$PIECE(Y,U,2)
SET ZTIO=$PIECE(Y(0),U,2)
+10 QUIT
+11 ;
IO3 ;IO2--?? help for device selection
+1 NEW ZT,ZT1,ZT2,ZT3,ZT4,ZTC
+2 WRITE !!?5,"These are the devices with waiting tasks:",!
+3 SET ZT1="IO"
SET ZT2=""
+4 FOR
SET ZT2=$ORDER(^%ZTSCH("IO",ZT2))
IF ZT2=""
QUIT
DO IOCNT
IF ZTC
WRITE !?5,ZT2,?40,ZTC," task",$SELECT(ZTC=1:"",1:"s")
+5 QUIT
+6 ;
IOCNT ;IO3--count tasks waiting for each device
+1 SET ZT3=""
SET ZTC=0
+2 FOR
SET ZT3=$ORDER(^%ZTSCH("IO",ZT2,ZT3))
SET ZT4=""
IF ZT3=""
QUIT
FOR
SET ZT4=$ORDER(^%ZTSCH("IO",ZT2,ZT3,ZT4))
IF ZT4=""
QUIT
SET ZTC=ZTC+1
+3 QUIT
+4 ;