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/ZOSVKSD.m@ 1154

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

initial load of WorldVistAEHR

File size: 4.2 KB
Line 
1%ZOSVKSD ;OAK/KAK - Calculate Disk Capacity ;5/9/07 10:36
2 ;;8.0;KERNEL;**121,197,268,456**;Jul 26, 2004
3 ;
4 ; This routine will help to calculate disk capacity for
5 ; either DSM or Cache system platforms by looking up
6 ; volume set table information
7 ;
8EN(SITENUM,SESSNUM,VOLS,OS) ;-- called by routine SYS+2^KMPSLK
9 ;--------------------------------------------------------------------
10 ; SITENUM = Station number of site
11 ; SESSNUM = SAGG session number
12 ; VOLS = Array containing names of monitored volumes
13 ; OS = Type of M platform (CVMS, CWINNT)
14 ;
15 ; Returns ^XTMP("KMPS",SITENUM,SESSNUM,"@VOL",vol_name) = vol_size
16 ;--------------------------------------------------------------------
17 ;
18 Q:'$G(SITENUM)
19 Q:$G(SESSNUM)=""
20 Q:$G(OS)=""
21 ;
22 D @OS
23 ;
24 Q
25 ;
26CVMS ;--------------------------------------------------------------------
27 ; Version for Cache for OpenVMS platform
28 ;--------------------------------------------------------------------
29 ;
30 ;-- code from routine %FREECNT
31 ;
32 N DIR
33 ;
34 S DIR=""
35 F S DIR=$O(^|"%SYS"|SYS("UCI",DIR)) Q:DIR="" D
36 .;
37 .N BLKSIZ,DIRUP,ISBIGDB,MAX,SIZE,VOLTOT,X,Y,ZU
38 .;
39 .Q:$G(^|"%SYS"|SYS("UCI",DIR))]""
40 .S X=DIR
41 .X ^%ZOSF("UPPERCASE")
42 .;
43 .; strip off trailing '\' if needed
44 .I $E(Y,$L(Y))="\" S Y=$E(Y,1,$L(Y)-1)
45 .S DIRUP=Y
46 .;
47 .; use $ZU(49) to see if directory is mounted
48 .S ZU=$ZU(49,DIR)
49 .;
50 .; quit if directory does not exist or is dismounted
51 .Q:ZU<0
52 .;
53 .; quit is directory is not mounted
54 .Q:+ZU=256
55 .;
56 .S ISBIGDB=0
57 .S BLKSIZ=$P(ZU,",",2)
58 .;
59 .I BLKSIZ>2048 D
60 ..S ISBIGDB=1
61 ..S VOLTOT=$P(ZU,",",22)
62 .;
63 .E D
64 ..I $ZBITGET($ZVERSION(0),21) S SIZE=+$P(ZU,",",23),MAX=$P(ZU,",",24)
65 ..E S SIZE=+$P(ZU,",",2),MAX=$P(ZU,",",4)
66 ..I 'SIZE Q
67 ..S VOLTOT=MAX*SIZE
68 .;
69 .;-- end of code from routine %FREECNT
70 .;
71 .D SETNODE(SITENUM,SESSNUM,DIRUP,VOLTOT)
72 ;
73 Q
74 ;
75CWINNT ;--------------------------------------------------------------------
76 ; Version for Cache for Windows NT platform
77 ;--------------------------------------------------------------------
78 ;
79 ;-- code from routine %FREECNT
80 ;
81 N DIR,DIRUP,VOLTOT
82 N X,Y,ZU
83 ;
84 S DIR=""
85 F S DIR=$O(^|"%SYS"|SYS("UCI",DIR)) Q:DIR="" D
86 .Q:$G(^|"%SYS"|SYS("UCI",DIR))]""
87 .S X=DIR
88 .X ^%ZOSF("UPPERCASE")
89 .;
90 .; strip off trailing '\' if needed
91 .I $E(Y,$L(Y))="\" S Y=$E(Y,1,$L(Y)-1)
92 .S DIRUP=Y
93 .;
94 .; use $ZU(49) to see if directory is mounted
95 .S ZU=$ZU(49,DIR)
96 .;
97 .; quit if directory does not exist or is dismounted
98 .Q:ZU<0
99 .;
100 .; quit is directory is not mounted
101 .Q:+ZU=256
102 .;
103 .; volume size = blocks per map * number of maps
104 .S VOLTOT=+$P(ZU,",",2)*$P(ZU,",",4)
105 .;
106 .;-- end of code from routine %FREECNT
107 .;
108 .D SETNODE(SITENUM,SESSNUM,DIRUP,VOLTOT)
109 ;
110 Q
111 ;
112SETNODE(SITENUM,SESSNUM,VOLNAM,VOLTOT) ;
113 ; Set the @VOL node in the ^XTMP("KMPS" global array
114 ;
115 ; quit if SAGG is not monitoring this volume set (directory)
116 Q:'$D(VOLS(VOLNAM))
117 ;
118 S ^XTMP("KMPS",SITENUM,SESSNUM,"@VOL",VOLNAM)=VOLTOT
119 Q
120 ;
121 ;
122DCMPST(VERSION) ;-
123 ;---------------------------------------------------------------------------
124 ;---------------------------------------------------------------------------
125 Q:$G(VERSION)="" ""
126 I VERSION<5.1 D DecomposeStatus^%DM(RC,.MSGLIST,0,"") Q
127 E D DecomposeStatus^%SYS.DATABASE(RC,.MSGLIST,0,"")
128 Q
129 ;
130GETDIRGL(VERSION) ;-extrinsic function
131 ;----------------------------------------------------------------------------
132 ; ; set up GLOARRAY array indexed by global name
133 ;----------------------------------------------------------------------------
134 Q:$G(VERSION)="" ""
135 I VERSION<5.1 Q $$GetDirGlobals^%DM(DIRNAM,.GLOARRAY)
136 E Q $$GetDirGlobals^%SYS.DATABASE(DIRNAM,.GLOARRAY)
137 ;
138GLOINTEG(VERSION) ;- extrinsic function
139 ;----------------------------------------------------------------------------
140 ; check integrity of a single global
141 ; will stop if there are more than 999 errors with this global
142 ;----------------------------------------------------------------------------
143 Q:$G(VERSION)="" ""
144 I VERSION<5.1 Q $$CheckGlobalIntegrity^%DM(DIRNAM,GLO,999,.GLOTOTBLKS,.GLOPNTBLKS,.GLOTOTBYTES,.GLOPNTBYTES,.GLOBIGBLKS,.GLOBIGBYTES,.GLOBIGSTRINGS,.DATASIZE)
145 E Q $$CheckGlobalIntegrity^%SYS.DATABASE(DIRNAM,GLO,999,.GLOTOTBLKS,.GLOPNTBLKS,.GLOTOTBYTES,.GLOPNTBYTES,.GLOBIGBLKS,.GLOBIGBYTES,.GLOBIGSTRINGS,.DATASIZE)
Note: See TracBrowser for help on using the repository browser.