1 | %ZTBKC1 ;SF/GJL - M/SQL BLOCK COUNT ;6/14/90 15:50
|
---|
2 | ;;8.0;KERNEL;;JUL 10, 1995
|
---|
3 | O 63 E S %T="The VIEW device is busy." G EXIT
|
---|
4 | V 1 S %B=$V(12+1024,0,3)
|
---|
5 | MVXGD V %B S %G="",%E=$V(2046,0,2),%O=0
|
---|
6 | F %I=0:1 Q:%E'>%O S %Z=$V(%O,0),%O=%O+1 S:(%Z#256) %G=%G_$C(%Z) I (%Z#256)=0 Q:%G=$P(X,"(",1) S %G="",%O=%O+9
|
---|
7 | I %G'="" S %T=0,%O=%O+6 D MVXPTDW S %B=%L G MVXPTBK:%B\256-65535 S %T="IMPLICIT" G EXIT
|
---|
8 | S %B=$V(2040,0,3) I %B G MVXGD
|
---|
9 | G EXIT
|
---|
10 | MVXPTBK V %B S (%H,%J,%L,%N)=0 I $V(2043,0,1)=8 G MVXDATA
|
---|
11 | MVXPTLP S %N=%N+1,%F=$V(%N-1*2+1,-6) I %F'="" G MVXPTNT
|
---|
12 | S %B=$V(2040,0,3) I %B=0 S %B=%L
|
---|
13 | I %B G MVXPTBK
|
---|
14 | G EXIT
|
---|
15 | MVXPTNT D MVXNODE I %I=2 S %L=$V(%N-1*2+2,-6) G MVXPTLP
|
---|
16 | I %I=1,%L=0 S %L=$V(%N-1*2+2,-6)
|
---|
17 | S %B=%L G MVXPTBK
|
---|
18 | MVXPTDW S %L=$V(%O,0,3)
|
---|
19 | Q
|
---|
20 | MVXDTBK V %B S %N=0,%T=%T+1,%J=0
|
---|
21 | MVXDATA S %N=%N+1,%F=$V(%N-1*2+1,-6) I %F'="" G MVXDTNT
|
---|
22 | MVXNBLK S %B=$V(2040,0,3) I %B G MVXDTBK
|
---|
23 | G EXIT
|
---|
24 | MVXDTNT S %J=%J+1 D MVXNODE I %I=1 S:%H=0 %T=%T+1 S %H=1 G MVXNBLK ;Next BLK
|
---|
25 | I %I=2 G MVXDATA
|
---|
26 | S:%J=1 %T=%T-1 G EXIT
|
---|
27 | MVXNODE S %F=$E(%F,$L(%G)+1,256),%M="",%I=0
|
---|
28 | MVXPROC S %I=%I+1 I %I>$L(%F) G MVXTSTN
|
---|
29 | S %V=$A(%F,%I) I %V=0 S %M=%M_"," G MVXPROC ;Level
|
---|
30 | I %V=1 G MVXZERO
|
---|
31 | I %V>31 S %M=%M_$C(%V) ;ASCII and Pos
|
---|
32 | G MVXPROC
|
---|
33 | MVXZERO S %I=%I+1,%V=$A(%F,%I) I %V=48 S %M=%M_"0" G MVXPROC
|
---|
34 | S %S="",%V=30-%V+1
|
---|
35 | MVXNEG S %I=%I+1 I $A(%F,%I)'=255 S %S=%S_$C(105-$A(%F,%I)) G MVXNEG
|
---|
36 | I %V<$L(%S) S %S=$E(%S,0,%V)_"."_$E(%S,%V+1,512)
|
---|
37 | S %M=%M_"-"_%S G MVXPROC
|
---|
38 | MVXTSTN S %M=$E(%M,2,256),%S=$P(X,"(",2),%S=$P(%S,")",1) I (%S="")!(%S=%M) S %I=1 Q
|
---|
39 | MVXTSTL S %X=$P(%S,",",1),%Y=$P(%M,",",1) I +%X'=%X G MVXSTR
|
---|
40 | I %Y="" S %I=2 Q
|
---|
41 | I +%Y'=%Y S %I=3 Q
|
---|
42 | I %X>%Y S %I=2 Q
|
---|
43 | I %X<%Y S %I=3 Q
|
---|
44 | MVXTSTC S %S=$P(%S,",",2,256) I %S="" S %I=1 Q
|
---|
45 | S %M=$P(%M,",",2,256) I %M="" S %I=2 Q
|
---|
46 | G MVXTSTL
|
---|
47 | MVXSTR I +%Y=%Y S %I=2 Q
|
---|
48 | I %X]%Y S %I=2 Q
|
---|
49 | I %X'=%Y S %I=3 Q
|
---|
50 | G MVXTSTC
|
---|
51 | ALL ;Entry point for block count of all globals.
|
---|
52 | ALLMVX ;Directory at ^UTILITY("GLO")
|
---|
53 | I '$D(^UTILITY("GLO",0)) W !,"No globals are listed in the ^UTILITY Directory !",! Q
|
---|
54 | W !!,$P(^UTILITY("GLO",0),"^",2)," " S %SK=$X+1 W "Globals",?(%SK+12),"Data Blocks"
|
---|
55 | S %DT="T",X="N" D ^%DT W ?(%SK+34),$E(Y,4,5),"/",$E(Y,6,7),"/",$E(Y,2,3) S Y=$P(Y,".",2) W " ",$E(Y,1,2),":",$E(Y,3,4),! K %DT,Y
|
---|
56 | S (%TOT,%GLO)=0 F %II=1:1 S X=$O(^UTILITY("GLO",%GLO)),%GLO=X Q:X="" I $D(^(X))#2,$P(^(X),"^",4)\256'=65535 W !,?%SK,X,?(%SK+15) S %T=-1 D %ZTBKC1 S X=%T S:X>0 %TOT=%TOT+X W:X<0 "-- no such global --" W:X'<0 X
|
---|
57 | W !!?%SK,"Total",?(%SK+15),%TOT K %GLO,%II,%SK,%TOT,X
|
---|
58 | EXIT C 63 K %,%A,%B,%C,%D,%E,%F,%G,%H,%I,%J,%K,%L,%M,%N,%O,%S,%V,%W,%X,%Y,%Z
|
---|
59 | Q
|
---|