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

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

initial load of WorldVistAEHR

File size: 2.3 KB
RevLine 
[613]1%ZTMS0 ;SEA/RDS-TaskMan: Submanager, Part 2 (Trap Functions) ;18 Jun 2003 6:40 pm
2 ;;8.0;KERNEL;**24,118,275**;JUL 10, 1995
3 ;
4ERROR2 ;ERROR--trap
5 L ^%ZTSCH("ER") H 1 S ZTH=$H
6 S ^%ZTSCH("ER",+ZTH,$P(ZTH,",",2))=$$EC^%ZOSV
7 S ^%ZTSCH("ER",+ZTH,$P(ZTH,",",2),1)="Caused by the submanager while trapping an error."
8 L
9 HALT
10 ;
11STATUS ;ERROR--update task's status in Task File, Call w/ ^%ZTSK locked
12 S ZTE=$E(%ZTME,1,70)
13 S ZTE=$TR(ZTE,"^","~")
14 S $P(^%ZTSK(%ZTMETSK,.1),"^",1,3)=$S(ZTQUEUED>.5:"C^",1:"L^")_$H_"^"_ZTE
15 S $P(^%ZTSK(%ZTMETSK,.12),"^",2,9)=ZTERROH_"^"_%ZTME
16 S ^%ZTSK(%ZTMETSK,.12,ZTERROH)=%ZTME
17 Q
18 ;
19DEVBAD ;ERROR--dequeue all entries for a bad device
20 N ZT,ZT1,ZT2,ZT3,ZT4
21 Q:'$$DEVLK^%ZTMS1(1,ZTDEVOK)
22 L +^%ZTSCH("IO"):5 G DBX:'$T S $P(^%ZTSCH("IO"),"^")=$$H3^%ZTM($H)
23 S ZT2=ZTDEVOK,ZT3=""
24 F S ZT3=$O(^%ZTSCH("IO",ZT2,ZT3)),ZT4="" Q:ZT3="" F S ZT4=$O(^%ZTSCH("IO",ZT2,ZT3,ZT4)) Q:ZT4="" L +^%ZTSK(ZT4) D DQ L -^%ZTSK(ZT4)
25 K ^%ZTSCH("IO",ZTDEVOK)
26 I $O(^%ZTSCH("IO",""))="" K ^%ZTSCH("IO")
27 L -^%ZTSCH("IO")
28DBX D DEVLK^%ZTMS1(-1,ZTDEVOK)
29 Q
30 ;
31DQ ;DEVBAD--remove a task from the waiting list for a bad device
32 K ^%ZTSCH("IO",ZT2,ZT3,ZT4)
33 S $P(^%ZTSK(ZT4,.1),"^",1,3)="B^"_$H_"^BAD IO DEVICE "_ZT2
34 K ^%ZTSK(ZT4,.26,ZT2)
35 I $O(^%ZTSK(ZT4,.26,""))]"" Q
36 K ^%ZTSK(ZT4,.26)
37 Q
38 ;
39ERCLOZ ;ERROR--close device after error
40 N %ZT1 S %ZT1=(IO=$G(^XUTL("XQ",$J,"IO")))
41 I 0[$I D ERC1
42 I $G(^XUTL("XQ",$J,"IO"))'=$I D ERC2
43 Q
44ERC1 ;Close current device
45 I %ZTME["data set hang-up" Q
46 I %ZTME["CLOSERR" Q
47 I %ZTME["DSCON" Q
48 I '$D(ZTQUEUED) Q:$D(IO)[0 Q:IO="" C:$O(^%ZISL(3.54,"B",IO,""))="" IO Q
49 I '$D(IO)&'($D(IOT)) Q
50 S IO("C")="" D ^%ZISC
51 Q
52ERC2 ;Close original Device
53 N POP
54 S POP=1 D RESETVAR^%ZIS Q:POP
55 ;S IOS=$P(%ZTTV,"^",2),(IO,IO(0))=$P(%ZTTV,"^",5),IOT=$P(%ZTTV,"^",6),IOF=$P(%ZTTV,"^",11),IOST=$P(%ZTTV,"^",12),IO("C")=""
56 I $D(IO(1,IO)) S IO("C")="" D ^%ZISC
57 Q
58 ;
59XREF ;ERROR--cross-reference TaskMan Error file entry by context of error
60 S ZTERROX=$S('%ZTMETSK:"an unknown task.",1:"Task # "_%ZTMETSK_".")
61 S ZTQUEUED=$G(ZTQUEUED)
62 I ZTQUEUED=0 S ZTERROX1="Caused by the submanager." Q
63 I ZTQUEUED=.5 S ZTERROX1="Caused by the submanager while preparing "_ZTERROX Q
64 I ZTQUEUED=.6 S ZTERROX1="Caused by submanager after "_ZTERROX Q
65 S ZTERROX1="Caused by "_ZTERROX
66 Q
67 ;
Note: See TracBrowser for help on using the repository browser.