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/ZOSVMSM.m@ 1150

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

initial load of WorldVistAEHR

File size: 5.3 KB
RevLine 
[613]1%ZOSV ;SFISC/AC - $View commands for MSM-PC/PLUS ;06/25/99 14:02
2 ;;8.0;KERNEL;**13,25,49,94,107,118**;Jul 10, 1995
3 ;
4ACTJ() ;Active Jobs
5 Q $S($$V3:$V($V(44)+168,-3,2),1:$V(168,-4,2))
6AVJ() ;Available jobs
7 Q $S($$V3:$V($V(44)+94,-3,2)+1-$V($V(44)+168,-3,2),1:$V($V(3,-5),-3,0)-$V(168,-4,2))
8 ;
9JOBPAR ;
10 S Y=$V(2,X,2) Q:'Y
11 S Y=$ZU(Y#32,Y\32) Q
12 ;
13PROGMODE() ;
14 Q $V(0,$J,2)#2
15PRGMODE ;
16 W ! S ZTPAC=$S('$D(^VA(200,+DUZ,.1)):"",1:$P(^(.1),U,5)),XUVOL=^%ZOSF("VOL")
17 I ZTPAC]"" X ^%ZOSF("EOFF") R !,"PAC: ",X:60 X ^%ZOSF("EON") I X'=ZTPAC W "??",*7 Q
18 K XMB,XMTEXT,XMY S XMB="XUPROGMODE",XMB(1)=DUZ,XMB(2)=$I D ^XMB:$L($T(^XMB)) D BYE^XUSCLEAN K ZTPAC,X,XMB
19 X ^%ZOSF("UCI") S XUCI=Y,XQZ="PRGM^ZUA[MGR]",XUSLNT=1 D DO^%XUCI
20 V 0:$J:$ZB($V(0,$J,2),1,7):2
21PRGMODEX W !,"YOU ARE NOW IN PROGRAMMING MODE!",! S $ECODE=",U<PROG>,"
22 Q
23 ;
24SIGNOFF ;
25 I 0
26 ;I $V($V(44)+4,-3,2)\32768#2 Q
27 Q
28UCI ;
29 S Y=$ZU(0) Q ;X ^%ZOSF("UCI") Q
30 ;
31UCICHECK(X) ;
32 N Y,I S Y="",$ZT="BADUCI^%ZOSV"
33 I X["," S Y=$ZU($P(X,","),$P(X,",",2)),(X,Y)=$ZU($P(Y,","),$P(Y,",",2)) Q:Y]"" Y
34 F I=1:1:64 G:$ZU(I)="" BADUCI Q:$ZU(I)=X!($P($ZU(I),",")=X)!(I=X)
35 Q $ZU(I)
36 ;
37SHARELIC(TYPE) ;Intersystem Cache and DSM only
38 Q
39 ;
40BADUCI Q ""
41 ;
42BAUD S X=9600
43 Q
44 ;
45LGR() Q $ZR ;Last global ref.
46 ;
47EC() Q $ZE ;Error code
48 ;
49DOLRO ;SAVE ENTIRE SYMBOL TABLE IN LOCATION SPECIFIED BY X
50 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
51 Q
52 ;
53ORDER ;SAVE PART OF SYMBOL TABLE IN LOCATION SPECIFIED BY X
54 S (Y,Y1)=$P(Y,"*",1) I $D(@Y)=0 F %=0:0 S Y=$O(@Y) Q:Y=""!(Y[Y1)
55 Q:Y="" S %=$D(@Y) S:%#2 @(X_"Y)="_Y) I %>9 S %X=Y_"(",%Y=X_"Y," D %XY^%RCR
56 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
57 K %,X,Y,Y1 Q
58 ;
59PRIORITY ;
60 Q:X>5 N %D,%P S %P=(X>5) D INT^%HL Q
61 ;
62PRIINQ() ;
63 Q $S($V(20,$J,2):10,1:1)
64PARSIZ ;
65 S X=3 Q
66 ;
67NOLOG ;
68 S Y=$S($$V3:"$V($V(44)+4,-3,2)",1:"$V(4,-4,2)")_"\64#2" Q
69 ;
70DEVOPN ;
71 ;X=$J,Y=List of devices separated by a comma
72 N %,%1,%I,%X
73 S Y=""
74 I $$V3 S %=$V($V(44)+10,-3,2),%1=$V($V(44)+8,-3,2)+$V(44),%=$V(%*5+%1)
75 E S %=$V(5,-5,0)
76 F %I=1:1:255 S %X=$V(%+%I+%I,-3,2) I %X,%X#4=0,%X/4=X S Y=Y_%I_","
77 Q
78DEVOK ;
79 ;X=Device $I, Y=0 if available, Y=Job # if owned,
80 ;Y=-1 if device is undefined.
81 G RES:$G(X1)="RES" I $E(X)="/"!($E(X)="\") S Y=0 Q
82 I X=2 S Y=0 Q
83 I X'?1.N!(X'>0!(X'<1024)) S Y=-1 Q
84 N %
85 I $$VERSION(1)["NT" D DVOPN Q
86 ;
87 I $$V3 S %=$V($V(44)+8,-3,2)+$V(44),%=$V($V($V(44)+10,-3,2)*5+%),Y=$V(%+X+X,-3,2),Y=$S(Y=0:0,Y#4=0:Y/4,1:-1)
88 E S %=$V(5,-5,0),Y=$V(%+X+X,-3,2),Y=$S(Y=0:0,Y#4=0:Y/4+$V(272,-4),1:-1)
89 I 'Y D DVOPN Q
90 S:Y=$J Y=0 Q
91DVOPN S $ZT="DVERR",Y=0 Q:$D(%ZTIO)
92 L:$D(%ZISLOCK) +@%ZISLOCK:60
93 O X::$S($D(%ZISTO):%ZISTO,1:0) E S Y=999 L:$D(%ZISLOCK) -@%ZISLOCK Q
94 L:$D(%ZISLOCK) -@%ZISLOCK
95 S Y=0 I '$D(%ZISCHK)!$S($D(%ZIS)#2:(%ZIS["T"),1:0) C X Q
96 S:X]"" IO(1,X)="" Q
97DVERR I $ZE["OPENERR" S Y=-1 L:$D(%ZISLOCK) -@%ZISLOCK Q
98 I $ZE["<NODEV>" S Y=-1 L:$D(%ZISLOCK) -@%ZISLOCK Q
99 ZQ
100RES S Y=0,%ZISD0=$O(^%ZISL(3.54,"B",X,0))
101 I '%ZISD0 S Y=-1,%ZISD0=%O(^%ZIS(1,"C",X,0)) Q:'%ZISD0 Q:'$D(^%ZIS(1,+%ZISD0,0)) Q:$P(^(0),"^")'=X Q:'$D(^("TYPE")) Q:^("TYPE")'="RES" S Y=0 Q
102 S X1=$S($D(^%ZISL(3.54,+%ZISD0,0)):^(0),1:"")
103 I $P(X1,"^",2)&(X=$P(X1,"^")) S Y=0 Q
104 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
105 K %ZISD0,%ZISD1
106 Q
107V2CL1 F %=0:0 Q:$ZA<0 R %X:5 Q:%X']"" F %1=0:0 S %1=$L(%Y),%Y=%Y_$E(%X,1,255-%1),%X=$E(%X,256-%1,$L(%X)),%1=$F(%Y,%ZCR) Q:%1'>0 S %2=$E(%Y,$A(%Y)=10+1,%1-2),%Y=$E(%Y,%1,$L(%Y)) D V2CL2
108 I %Y]"" S %2=$E(%Y,$A(%Y)=10+1,$L(%Y)) D V2CL2
109 C 2:256 K IO(1,2) D CLOSE^ZISPL1 K %Y,%X,%1,ZOSFV
110 Q
111V2CL2 S %1=$F(%2,$C(12)) I %1>0 S %=%+1 D LIMIT:%Z1<% Q:%Z1<% S ^XMBS(3.519,XS,2,%,0)="|TOP|",%2=$E(%2,1,%1-2)_$E(%2,%1,$L(%2))
112 S %=%+1,^XMBS(3.519,XS,2,%,0)=%2 Q
113 ;
114LIMIT S ^XMBS(3.519,XS,2,%,0)="*** INCOMPLETE REPORT -- SPOOL DOCUMENT LINE LIMIT EXCEEDED ***",$P(^XMB(3.51,%ZDA,0),"^",11)=1 Q
115 ;
116SET ;SET SPECIAL VARIABLES
117 S X=$H X ^%ZOSF("ZD") S DT=$E(Y,7,8)+200_$E(Y,1,2)_$E(Y,4,5)
118 Q
119GETENV ;Get enviroment (UCI^VOL^NODE)
120 S Y=$P($ZU(0),",",1)_"^"_$P($ZU(0),",",2)_"^^"_$P($ZU(0),",",2)
121 Q
122VERSION(X) ;return OS version, X=1 - return OS
123 Q $S($G(X):$P($ZV,"Version "),1:$P($ZV,"Version ",2))
124V3() ;returns 1=version 3, 0=version 4
125 Q $P($ZV,"Version ",2)<4
126OSTYPE() ;Return 1 = PC/PLUS, 2 = NT, 3 = UNIX
127 N % S %=$$VERSION(1)
128 Q $S(%["MSM-PC/PLUS":1,%["Windows NT":2,1:3)
129 ;
130SETNM(X) ;Set name, Fall into SETENV
131SETENV ;Set enviroment
132 Q
133 ;
134T0 ; start RT clock
135 I $$OSTYPE()'=1 S XRT0=$H Q
136 S XRT0=$P($H,",")_","_($V(#46C,-3,4)*5.4925\1/100) Q
137T1 ; store RT datum
138 I $$OSTYPE()'=1 S ^%ZRTL(3,XRTL,+$H,$P($H,",",2))=XRT0 K XRT0 Q
139 S ^%ZRTL(3,XRTL,+$H,XRTN,$V(#46C,-3,4)*5.4925\1/100)=XRT0 K XRT0 Q
140 ;
141ZHDIF ;Display dif of two $$ZH^%MSMOPS's
142 S U="^" W !?2,"CPU=",$J($P(%ZH1,U)-$P(%ZH0,U),6,2),?14,"ET=",$J($P(%ZH1,U,7)-$P(%ZH0,U,7),6,2),?25,"PRD=",$J($P(%ZH1,U,3)-$P(%ZH0,U,3),4),?35,"LRD=",$J($P(%ZH1,U,2)-$P(%ZH0,U,2),6),?47,"LWT=",$J($P(%ZH1,U,4)-$P(%ZH0,U,4),5)
143 W ?58,"TI=",$J($P(%ZH1,U,5)-$P(%ZH0,U,5),4),?67,"TO=",$J($P(%ZH1,U,6)-$P(%ZH0,U,6),5)
144 Q
145LOGRSRC(OPT,TYPE,STATUS) ;record resource usage in ^XTMP("KMPR"
146 Q:($$OSTYPE'=1)!('$G(^%ZTSCH("LOGRSRC"))) ; quit if RUM not turned on.
147 ; call to RUM routine.
148 D RU^%ZOSVKR($G(OPT),$G(TYPE),$G(STATUS))
149 Q
150SETTRM(X) ;Set specified terminators.
151 U $I:(::::::::X)
152 Q 1
Note: See TracBrowser for help on using the repository browser.