source: WorldVistAEHR/trunk/r/VA_FILEMAN-ARJT-DI-DD-DM-DT-%DT-%RCR/DINV1VXD.m@ 1589

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

initial load of WorldVistAEHR

File size: 1.7 KB
Line 
1ZOSV1VXD ;SFISC/AC - View commands & special functions(continued). ;1:05 PM 30 Sep 1998
2 ;;22.0;VA FileMan;;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4DEVOPN ;List devices opened.
5 N %,%B,%I,%L,%X,%X1,%X2,%Y
6 S %X1=$V($V(0)+8),%X2=$V(%X1),Y=""
7 F %I=1:1 D D1 S %X2=$V(%X2) Q:%X2=%X1
8 Q
9D1 S %X=$V(%X2+8)
10 S %L=$V(%X+4,-1,1),%B=$V(%X+8)
11 S %Y=""
12 F %=1:1:%L S %Y=%Y_$C($V(%B,-1,1)) S %B=%B+1
13 S Y=Y_%Y_"," Q
14 ;
15DEVOK ;Check Device Availability. (not complete)
16 ;INPUT: X=Device $I, X1=IOT -- X1 needed for resources
17 ;OUTPUT: Y=0 if available, Y=job # if owned, Y=-1 if device does not exists.
18 S Y=0 Q:X["::" I $G(X1)="RES" G RES
19 S Y=$ZC(%GETDVI,X,"EXISTS")
20 G DV1:Y D DV2 Q:Y=-1 I Y="TERM" S Y=-1 Q
21 S Y=-2 Q
22DV1 S Y=$ZC(%GETDVI,X,"PID") I Y=$J!($ZC(%GETDVI,X,"SPL")) S Y=0 Q
23 I Y,$ZC(%GETJPI,X,"MASTER_PID")=Y G DVOPN
24 Q:Y>0 D DV2 G DVOPN:Y="TERM" S Y=$S(Y="DISK":0,Y="MAILBOX":0,Y="TAPE":0,1:-1) Q
25DV2 S Y=$ZC(%PARSE,X) I Y="" S Y=-1 Q
26 I X]"" S Y=$ZC(%GETDVI,$S(Y]"":Y,1:X),"DEVCLASS") Q
27 Q
28DVOPN S $ZT="DVERR",Y=0 Q:$D(%ZTIO)
29 L:$D(%ZISLOCK) +@%ZISLOCK:60
30 O X::$S($D(%ZISTO):%ZISTO,1:0) E S Y=999 L:$D(%ZISLOCK) -@%ZISLOCK:60 Q
31 L:$D(%ZISLOCK) -@%ZISLOCK
32 S Y=0 I '$D(%ZISCHK)!$S($D(%ZIS)#2:(%ZIS["T"),1:0) C X Q
33 S:X]"" IO(1,X)="" Q
34DVERR I $ZE["OPENERR" S Y=-1 Q
35 ZQ
36RES S Y=0,%ZISD0=$O(^%ZISL(3.54,"B",X,0))
37 I '%ZISD0 S Y=-1,%ZISD0=$O(^%ZIS(1,"C",X)) Q:'%ZISD0 Q:'$D(^%ZIS(1,+%ZISD0,0)) Q:$P(^(0),"^")'=X Q:'$D(^("TYPE")) Q:^("TYPE")'="RES" S Y=0 Q
38 S X1=$S($D(^%ZISL(3.54,+%ZISD0,0)):^(0),1:"")
39 I $P(X1,"^",2)&(X=$P(X1,"^")) S Y=0 Q
40 S Y=999 F %ZISD1=0:0 S %ZISD1=$O(^%ZISL(3.54,%ZISD0,1,%ZISD1)) Q:%ZISD1'>0 I $D(^(%ZISD1,0)) S Y=$P(^(0),"^",3) Q
41 K %ZISD0,%ZISD1
42 Q
Note: See TracBrowser for help on using the repository browser.