source: FOIAVistA/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/ZTBKCMSQ.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
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)
5MVXGD 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
10MVXPTBK V %B S (%H,%J,%L,%N)=0 I $V(2043,0,1)=8 G MVXDATA
11MVXPTLP 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
15MVXPTNT 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
18MVXPTDW S %L=$V(%O,0,3)
19 Q
20MVXDTBK V %B S %N=0,%T=%T+1,%J=0
21MVXDATA S %N=%N+1,%F=$V(%N-1*2+1,-6) I %F'="" G MVXDTNT
22MVXNBLK S %B=$V(2040,0,3) I %B G MVXDTBK
23 G EXIT
24MVXDTNT 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
27MVXNODE S %F=$E(%F,$L(%G)+1,256),%M="",%I=0
28MVXPROC 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
33MVXZERO S %I=%I+1,%V=$A(%F,%I) I %V=48 S %M=%M_"0" G MVXPROC
34 S %S="",%V=30-%V+1
35MVXNEG 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
38MVXTSTN S %M=$E(%M,2,256),%S=$P(X,"(",2),%S=$P(%S,")",1) I (%S="")!(%S=%M) S %I=1 Q
39MVXTSTL 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
44MVXTSTC 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
47MVXSTR 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
51ALL ;Entry point for block count of all globals.
52ALLMVX ;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
58EXIT 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
Note: See TracBrowser for help on using the repository browser.