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

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

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1%ZOSV ;SFISC/AC - $View commands for Open M for NT. ;2:42 PM 1 Oct 1998
2 ;;22.0;VA FileMan;;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4ACTJ() ;# Active jobs
5 N Y,% S %=0 F Y=0:1 S %=$ZJ(%) Q:%=""
6 Q Y
7AVJ() ;# available jobs
8 ;Return fixed value if version < 2.1.6 (e.i. not Cache)
9 N v S v=$$VERSION($ZV) I 216>$TR(v,".") Q 15 ;
10 N maxpid s maxpid=$v($zu(40,2,118),-2,4) ;from %SS
11 Q maxpid-$$ACTJ() ;need ISM to provide maxpid in ^%MACHINE
12PRIINQ() ;
13 Q 8
14UCI ;Current UCI
15 S Y=$ZU(5)_","_^%ZOSF("VOL") Q
16 ;
17UCICHECK(X) ;Check if valid UCI
18 N Y,%
19 S %=$P(X,",",1),Y=0 I $ZU(90,10,%) S Y=%
20 Q Y
21JOBPAR ;See if X points to a valid Job. Return its UCI.
22 N ZJ S Y="",$ZT="JOBX"
23 Q:'$D(^$JOB(X)) S Y=$V(-1,X),Y=$P(Y,"^",14)_","_^%ZOSF("VOL")
24JOBX Q
25 ;
26T0 ; start RT clock
27 S XRT0=$H Q
28T1 ; store RT datum
29 S ^%ZRTL(3,XRTL,+$H,XRTN,$P($H,",",2))=XRT0 K XRT0 Q
30NOLOG ;
31 S Y="$V(0,-2,4)\4096#2" Q
32 ;
33PROGMODE() ;Check if in PROG mode
34 Q $ZJ#2
35 ;
36PRGMODE ;
37 W ! S ZTPAC=$S('$D(^VA(200,+DUZ,.1)):"",1:$P(^(.1),U,5)),XUVOL=^%ZOSF("VOL")
38 S X="" X ^%ZOSF("EOFF") R:ZTPAC]"" !,"PAC: ",X:60 D LC^XUS X ^%ZOSF("EON") I X'=ZTPAC W "??",*7 Q
39 S XMB="XUPROGMODE",XMB(1)=DUZ,XMB(2)=$I D ^XMB:$L($T(^XMB)) D BYE^XUSCLEAN K ZTPAC,X,XMB
40 D UCI S XUCI=Y,XQZ="PRGM^ZUA[MGR]",XUSLNT=1 D DO^%XUCI D ^%PMODE U $I:("":"+B+C+R") S $ZT="" Q
41 Q
42LGR() S $ZT="LGRX^%ZOSV"
43 Q $ZR ;Last Global ref.
44LGRX Q ""
45 ;
46EC() Q $ZE ;Error code
47 ;
48DOLRO ;SAVE ENTIRE SYMBOL TABLE IN LOCATION SPECIFIED BY X
49 S Y="%" F %=0:0 S Y=$O(@Y) Q:Y="" S %=$D(@Y) S:%#2 @(X_"Y)="_Y) I %>9 S %X=Y_"(",%Y=X_"Y," D %XY^%RCR
50 Q
51 ;
52ORDER ;SAVE PART OF SYMBOL TABLE IN LOCATION SPECIFIED BY X
53 S (Y,Y1)=$P(Y,"*",1) I $D(@Y)=0 F %=0:0 S Y=$O(@Y) Q:Y=""!(Y[Y1)
54 Q:Y="" S %=$D(@Y) S:%#2 @(X_"Y)="_Y) I %>9 S %X=Y_"(",%Y=X_"Y," D %XY^%RCR
55 F %=0:0 S Y=$O(@Y) Q:Y=""!(Y'[Y1) S %=$D(@Y) S:%#2 @(X_"Y)="_Y) I %>9 S %X=Y_"(",%Y=X_"Y," D %XY^%RCR
56 K %,X,Y,Y1 Q
57 ;
58PARSIZ ;
59 S X=3 Q
60 ;
61DEVOPN ;List of Devices opened
62 ;Returns variable Y. Y=Devices owned separated by a comma
63 S X=$J
64 N % S Y=$P($V(-1,$J),"^",3) F %=1:1:$L(Y,",") S $P(Y,",",%)=$P($P(Y,",",%),"*",1)
65 Q
66DEVOK ;
67 S Y=0,X1=$G(X1) Q:X=2 Q:(X1="HFS")!(X1="MT") G:X1="RES" RES ;Quit w/ OK for HFS, Spool, MT
68 S $ZT="OPNERR"
69 O X::$S($D(%ZISTO):%ZISTO,1:0) E S Y=999 Q ;G NOPN
70 S Y=0 I '$D(%ZISCHK)!$S($D(%ZIS)#2:(%ZIS["T"),1:0) C X Q
71 S:X]"" IO(1,X)="" Q
72 Q
73NOPN ;
74 N ZJ S $ZT="NJ"
75 S ZJ="" F %=0:0 S ZJ=$ZJ(ZJ) Q:'ZJ D NOPN1 Q:'ZJ
76 Q
77NOPN1 S Y=$V(-1,ZJ) I $P(Y,"^",3)[X_","!($P(Y,"^",3)[X_"*,") S Y=ZJ,ZJ="" Q
78 Q
79NJ Q ;NOJOB ERROR
80OPNERR S Y=-1 Q
81 ;
82RES S Y=0,%ZISD0=$O(^%ZISL(3.54,"B",X,0))
83 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
84 S X1=$S($D(^%ZISL(3.54,+%ZISD0,0)):^(0),1:"")
85 I $P(X1,"^",2)&(X=$P(X1,"^")) S Y=0 Q
86 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
87 K %ZISD0,%ZISD1
88 Q
89GETENV ;Get environment (UCI^VOL^NODE)
90 X ^%ZOSF("UCI") S Y=$P(Y,",")_"^"_^%ZOSF("VOL")_"^"_$ZU(110)_"^"_^%ZOSF("VOL")
91 Q
92VERSION(X) ;return OS version, X=1 - return OS
93 Q $S($G(X):$P($ZV,")")_")",1:$P($P($ZV,") ",2),"("))
94 ;
95SETNM(X) ;Set name, Fall into SETENV
96SETENV ;Set environment
97 Q
98 ;
99HFSREW(IO,IOPAR) ;Rewind Host File.
100 S $ZT="HFSRWERR"
101 C IO O @(""""_IO_""""_$S(IOPAR]"":":"_IOPAR_":1",1:":1")) I '$T Q 0
102 Q 1
103HFSRWERR ;Error encountered
104 Q 0
105LOGRSRC(OPT) ;record resource usage in ^XTMP("KMPR"
106 D RO^%ZOSVKR(OPT)
107 Q
108SETTRM(X) ;Turn on specified terminators.
109 U $I:(::X)
110 Q 1
Note: See TracBrowser for help on using the repository browser.