source: FOIAVistA/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XUTMQ3.m@ 1582

Last change on this file since 1582 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.3 KB
Line 
1XUTMQ3 ;SEA/RDS - TaskMan: Option, ZTMINQ, Part 5 (Modules) ;03/09/2000 12:58
2 ;;8.0;KERNEL;**136**;Jul 10, 1995
3 ;
4ENTRY G ^XUTMQ
5 ;
6PRINT ;Subroutine--Print A Task
7 N ZTSK W:'ZTC @IOF,!,ZTH,! W:'ZTF !,"-------------------------------------------------------------------------------"
8 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
9 S ZTC=ZTC+1 Q
10 ;
11OUT ;Tag for breaking FOR scope to exit early
12 Q
13 ;
14IOQ0 ;IOQ--Extending Scope Of FOR Loop
15 S ZTS=ZT3 D PRINT Q:X
16 Q
17 ;
18IO ;IO1--List the tasks waiting for the selected device
19 S X=0,ZTC=0,ZTF=1,ZTH="Tasks waiting for device "_ZTION_"..."
20 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
21 Q:X W:'ZTC !?5,"On this volume set there are no tasks waiting for that device." W ! Q
22 ;
23IOQ ;Tasks waiting for devices.
24 N DIR,DIRUT,DTOUT,DUOUT,X,ZT,ZT1,ZT2,ZT3,ZTC,ZTF,ZTH,ZTS S ZTC=0,ZTF=1,ZTH="Tasks waiting for devices..."
25 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
26 I 'ZTC W !!,"There are no tasks waiting for devices on this volume set."
27 W ! S DIR(0)="E",DIR("A")=$S(ZTC:"End of listing. ",1:"")_"Press RETURN to continue" D ^DIR Q
28 ;
29IO1 ;Waiting list for a device
30 N DIR,DIRUT,DTOUT,DUOUT,X,ZT,ZT1,ZT2,ZT3,ZTC,ZTF,ZTIO,ZTION,ZTH,ZTS
31 F ZT=0:0 D IO2 Q:ZTION="" S ZT1=ZTIO D IO Q:X
32 Q
33 ;
34IO2 ;IO1--prompt user for a device
35 S DIR(0)="PO^3.5:EMQZ"
36 S DIR("A")="Select DEVICE"
37 S DIR("?",1)=" Answer should be a device whose waiting list you want to see."
38 S DIR("?")=" Enter ?? for a list of devices with waiting tasks."
39 S DIR("??")="^D IO3^XUTMQ3"
40 D ^DIR K DIR
41 I $D(DTOUT) W $C(7)
42 I $D(DIRUT) S ZTION="" Q
43 S ZTION=$P(Y,U,2),ZTIO=$P(Y(0),U,2)
44 Q
45 ;
46IO3 ;IO2--?? help for device selection
47 N ZT,ZT1,ZT2,ZT3,ZT4,ZTC
48 W !!?5,"These are the devices with waiting tasks:",!
49 S ZT1="IO",ZT2=""
50 F S ZT2=$O(^%ZTSCH("IO",ZT2)) Q:ZT2="" D IOCNT I ZTC W !?5,ZT2,?40,ZTC," task",$S(ZTC=1:"",1:"s")
51 Q
52 ;
53IOCNT ;IO3--count tasks waiting for each device
54 S ZT3="",ZTC=0
55 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
56 Q
57 ;
Note: See TracBrowser for help on using the repository browser.