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

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

initial load of WorldVistAEHR

File size: 4.5 KB
Line 
1%ZOSV ;SFISC/AC,LL/DFH,sfisc/fyb ;2:33 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.
4 ; ** For DataTree **
5 ;
6ACTJ() ; Active Jobs
7 Q $$njobs^%mjob("running")
8 ;
9AVJ() ; Available Jobs
10 Q $$njobs^%mjob("free")
11 ;
12T0 ; start RT clock
13 S XRT0=$H Q
14T1 ; store RT datum
15 S ^%ZRTL(3,XRTL,+$H,XRTN,$P($H,",",2))=XRT0 K XRT0 Q
16MAXJ ; Maximum # of Jobs
17 S Y=$$njobs^%mjob("total") Q
18 ;
19BAUD ; Baud rate of device - used by BAUD field of the Device File
20 ; Internal entry of device is D0
21 ;ZETRAP BAUDERR
22 ;S X=$zdevspeed($P(^%ZIS(1,D0,0),"^",2)) Q
23 Q
24BAUDERR S X="" Q
25 ;
26LGR() Q $ZR ;Last global reference
27 ;
28EC() Q $ZE ;Error code
29 ;
30DEVOPN ;X=$J,Y=List of devices separated by a comma
31 G DEVOPN^%ZOSV1
32 ;
33DEVOK ;X=Device $I, Y=0 if available, Y=999 if device is busy
34 ;Y=-1 if device is undefined.
35 G RES:$G(X1)="RES" I $E(X)="/"!($E(X)="\") S Y=0 Q
36 I $D(X)[0 S X=$I
37 I X=$I S Y=$J Q
38 I X<20,(X>9) S Y=0 D NULLDEV O X:("W":NULLDEV):0 C:$T X S:'$T Y=999 Q
39 ZETRAP NODEV
40 O X::0 I '$T S Y=999 Q
41 C X S Y=0
42 Q
43RES S Y=0,%ZISD0=$O(^%ZISL(3.54,"B",X,0))
44 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
45 S X1=$S($D(^%ZISL(3.54,+%ZISD0,0)):^(0),1:"")
46 I $P(X1,"^",2)&(X=$P(X1,"^")) S Y=0 Q
47 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
48 K %ZISD0,%ZISD1
49 Q
50NULLDEV ; based on %device
51 K HWTYPE S NULLDEV="NUL",H=$V($S($P($ZVER,"/",2)<4:4,1:1),3,-1)
52 S HWTYPE=$S(H<10:"WS",H<20:"MF",H<64:"?",H<129:"PC",1:"?")
53 I HWTYPE'="PC" S NULLDEV="[NUL]"
54 K H,HWTYPE Q
55 ;
56NODEV S Y=-1
57 Q
58 ;
59DOLRO ;SAVE ENTIRE SYMBOL TABLE IN LOCATION SPECIFIED BY X
60 ;I $P($ZVER,"/",2)<4 D ^%VARLOG
61 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
62 Q
63 ;
64ORDER ; Save part of the symbol table in location specified by X
65 S (Y,Y1)=$P(Y,"*",1) I $D(@Y)=0 F %=0:0 S Y=$O(@Y) Q:Y=""!(Y[Y1)
66 Q:Y="" S %=$D(@Y) S:%#2 @(X_"Y)="_Y)
67 I %>9 S %X=Y_"(",%Y=X_"Y," D %XY^%RCR
68 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
69 K %,X,Y,Y1 Q
70 ;
71JOBPAR ; Returns job X's namespace
72 D JSTAT^%ZOSV1
73 I ($P($ZVER,"/",2)'<4)&($P($ZVER,"/",2)<4.3) S Y=$ZCONVERT($V(0,JA+908,-5),"U")
74 E S Y=$$jstat^%mjob(X),Y=$P(Y,"|",4)
75 Q
76 ;
77 ;
78NOLOG ; No logins allowed
79 S Y=0 Q
80 ;
81PARSIZ ;
82 S X=3 Q
83 ;
84PRIINQ() ; Priority Inquire
85 N X,Y S X=$J ;D JSTAT^%ZOSV1
86 ;I ZVER S Y=$V(0,$V(1,(X-1*2)+100,-2)*16+5,-1)-128\2 S:Y Y=10-Y
87 S Y=$$jstat^%mjob(X),Y=$P(Y,"|",7) S:Y Y=10-Y
88 Q Y
89 ;
90PRIORITY ; Set priority of job
91 I X<1!(X>10) Q
92 S Y=X,X=10-X ; convert Kernel to DTM priority
93 I $P($ZVER,"/",2)<4 V 64+$J:50:$C(128+X) Q
94 S X=X*2+128 zc #changepriority(X) V 2:5:$C(X)
95 Q
96PRGMODE ;
97 W ! S ZTPAC=$S($D(^VA(200,+DUZ,.1))#10:$P(^(.1),"^",5),1:""),XUVOL=^%ZOSF("VOL")
98 I ZTPAC]"" X ^%ZOSF("EOFF") R !,"PAC: ",X:60 S X=$ZCONVERT(X,"U") X ^%ZOSF("EON") I X'=ZTPAC W "??",*7 Q
99 S XMB="XUPROGMODE",XMB(1)=DUZ,XMB(2)=$I D ^XMB:$L($T(^XMB)) D BYE^XUSCLEAN K ZTPAC,X,XMB
100 X ^%ZOSF("UCI") S XUCI=Y,XQZ="PRGM^ZUA[MGR]",XUSLNT=1 D DO^%XUCI
101 U:$I>99 $I:IXXLATE=2 D ^%mshell
102 ;
103UCICHECK(X) ; The call to ns^%m for Version 4 is necessary
104 ; only if namespaces are password protected.
105 ZETRAP BADUCI N CURUCI
106 S X=$P(X,",")
107 S X=$ZCONVERT(X,"U"),CURUCI=$ZNSPACE
108 I $P($ZVER,"/",2)<4 ZNSPACE X ZNSPACE CURUCI Q X
109 D ns^%m(X,1) S ^UTILITY($J)="" ; *** force error if dataset not mounted
110 I CURUCI'=X D ns^%m(CURUCI,1)
111 Q X
112BADUCI ; set flag and return to old namespace
113 S Y=0
114 I $P($ZVER,"/",2)<4 ZNSPACE CURUCI
115 E D ns^%m(CURUCI,1)
116 Q Y
117 ;
118VERSION(X) ;return OS version, X=1 - return OS
119 Q $S($G(X):$P($ZV,"/"),1:$P($ZV,"/",2))
120 ;
121SETNM(X) ;Set name, Fall into SETENV
122SETENV ; Set environment
123 S XUENV=X_"^"
124 I $P($ZVER,"/",2)>4.2 V 2:374:$C($L(X))_X:$J#256 Q
125 S X1=X,X=$J D JSTAT^%ZOSV1
126 V 0:JA+374:$C($L(X1))_X1
127 Q
128GETENV ; Get environment
129 S Y=$ZNSPACE_"^"_^%ZOSF("VOL")_"^^"_^%ZOSF("VOL")
130 Q
131TRMON ;Turn terminators on
132 U $I:IXINTERP=2 N % S %=$$getall^%mixinterp()
133 I $A(%)'=35 F %=0:1:31,127 D set^%mixinterp(%,35)
134 Q
135TRMOFF ;Turn terminators off
136 U $I:IXINTERP=$S($I>99:1,1:0)
137 Q
138PASSALL ;Pass all characters
139 U $I:IXINTERP=3 N % S %=$$getall^%mixinterp()
140 I $A(%)'=18 F %=0:1:31,127 D set^%mixinterp(%,18)
141 Q
142NOPASS ;Do not pass all characters
143 D TRMOFF
144 Q
145 ;
146HFSREW(IO,IOPAR) ;Rewind Host File
147 S $ZT="HFSRWERR"
148 U IO:(LFA=0)
149 Q 1
150HFSRWERR ;Error encountered.
151 Q 0
152LOGRSRC(OPT) ;record resource usage in ^XUCP
153 Q
154SETTRM(X) ;Turn on specified terminators.
155 U $I:TERM=X
156 Q 1
Note: See TracBrowser for help on using the repository browser.