Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ZOSVKSD

ZOSVKSD.m

Go to the documentation of this file.
  1. %ZOSVKSD ;OAK/KAK - Calculate Disk Capacity ;5/9/07 10:36
  1. ;;8.0;KERNEL;**121,197,268,456**;Jul 26, 2004
  1. ;
  1. ; This routine will help to calculate disk capacity for
  1. ; either DSM or Cache system platforms by looking up
  1. ; volume set table information
  1. ;
  1. EN(SITENUM,SESSNUM,VOLS,OS) ;-- called by routine SYS+2^KMPSLK
  1. ;--------------------------------------------------------------------
  1. ; SITENUM = Station number of site
  1. ; SESSNUM = SAGG session number
  1. ; VOLS = Array containing names of monitored volumes
  1. ; OS = Type of M platform (CVMS, CWINNT)
  1. ;
  1. ; Returns ^XTMP("KMPS",SITENUM,SESSNUM,"@VOL",vol_name) = vol_size
  1. ;--------------------------------------------------------------------
  1. ;
  1. Q:'$G(SITENUM)
  1. Q:$G(SESSNUM)=""
  1. Q:$G(OS)=""
  1. ;
  1. D @OS
  1. ;
  1. Q
  1. ;
  1. CVMS ;--------------------------------------------------------------------
  1. ; Version for Cache for OpenVMS platform
  1. ;--------------------------------------------------------------------
  1. ;
  1. ;-- code from routine %FREECNT
  1. ;
  1. N DIR
  1. ;
  1. S DIR=""
  1. F S DIR=$O(^|"%SYS"|SYS("UCI",DIR)) Q:DIR="" D
  1. .;
  1. .N BLKSIZ,DIRUP,ISBIGDB,MAX,SIZE,VOLTOT,X,Y,ZU
  1. .;
  1. .Q:$G(^|"%SYS"|SYS("UCI",DIR))]""
  1. .S X=DIR
  1. .X ^%ZOSF("UPPERCASE")
  1. .;
  1. .; strip off trailing '\' if needed
  1. .I $E(Y,$L(Y))="\" S Y=$E(Y,1,$L(Y)-1)
  1. .S DIRUP=Y
  1. .;
  1. .; use $ZU(49) to see if directory is mounted
  1. .S ZU=$ZU(49,DIR)
  1. .;
  1. .; quit if directory does not exist or is dismounted
  1. .Q:ZU<0
  1. .;
  1. .; quit is directory is not mounted
  1. .Q:+ZU=256
  1. .;
  1. .S ISBIGDB=0
  1. .S BLKSIZ=$P(ZU,",",2)
  1. .;
  1. .I BLKSIZ>2048 D
  1. ..S ISBIGDB=1
  1. ..S VOLTOT=$P(ZU,",",22)
  1. .;
  1. .E D
  1. ..I $ZBITGET($ZVERSION(0),21) S SIZE=+$P(ZU,",",23),MAX=$P(ZU,",",24)
  1. ..E S SIZE=+$P(ZU,",",2),MAX=$P(ZU,",",4)
  1. ..I 'SIZE Q
  1. ..S VOLTOT=MAX*SIZE
  1. .;
  1. .;-- end of code from routine %FREECNT
  1. .;
  1. .D SETNODE(SITENUM,SESSNUM,DIRUP,VOLTOT)
  1. ;
  1. Q
  1. ;
  1. CWINNT ;--------------------------------------------------------------------
  1. ; Version for Cache for Windows NT platform
  1. ;--------------------------------------------------------------------
  1. ;
  1. ;-- code from routine %FREECNT
  1. ;
  1. N DIR,DIRUP,VOLTOT
  1. N X,Y,ZU
  1. ;
  1. S DIR=""
  1. F S DIR=$O(^|"%SYS"|SYS("UCI",DIR)) Q:DIR="" D
  1. .Q:$G(^|"%SYS"|SYS("UCI",DIR))]""
  1. .S X=DIR
  1. .X ^%ZOSF("UPPERCASE")
  1. .;
  1. .; strip off trailing '\' if needed
  1. .I $E(Y,$L(Y))="\" S Y=$E(Y,1,$L(Y)-1)
  1. .S DIRUP=Y
  1. .;
  1. .; use $ZU(49) to see if directory is mounted
  1. .S ZU=$ZU(49,DIR)
  1. .;
  1. .; quit if directory does not exist or is dismounted
  1. .Q:ZU<0
  1. .;
  1. .; quit is directory is not mounted
  1. .Q:+ZU=256
  1. .;
  1. .; volume size = blocks per map * number of maps
  1. .S VOLTOT=+$P(ZU,",",2)*$P(ZU,",",4)
  1. .;
  1. .;-- end of code from routine %FREECNT
  1. .;
  1. .D SETNODE(SITENUM,SESSNUM,DIRUP,VOLTOT)
  1. ;
  1. Q
  1. ;
  1. SETNODE(SITENUM,SESSNUM,VOLNAM,VOLTOT) ;
  1. ; Set the @VOL node in the ^XTMP("KMPS" global array
  1. ;
  1. ; quit if SAGG is not monitoring this volume set (directory)
  1. Q:'$D(VOLS(VOLNAM))
  1. ;
  1. S ^XTMP("KMPS",SITENUM,SESSNUM,"@VOL",VOLNAM)=VOLTOT
  1. Q
  1. ;
  1. ;
  1. DCMPST(VERSION) ;-
  1. ;---------------------------------------------------------------------------
  1. ;---------------------------------------------------------------------------
  1. Q:$G(VERSION)="" ""
  1. I VERSION<5.1 D DecomposeStatus^%DM(RC,.MSGLIST,0,"") Q
  1. E D DecomposeStatus^%SYS.DATABASE(RC,.MSGLIST,0,"")
  1. Q
  1. ;
  1. GETDIRGL(VERSION) ;-extrinsic function
  1. ;----------------------------------------------------------------------------
  1. ; ; set up GLOARRAY array indexed by global name
  1. ;----------------------------------------------------------------------------
  1. Q:$G(VERSION)="" ""
  1. I VERSION<5.1 Q $$GetDirGlobals^%DM(DIRNAM,.GLOARRAY)
  1. E Q $$GetDirGlobals^%SYS.DATABASE(DIRNAM,.GLOARRAY)
  1. ;
  1. GLOINTEG(VERSION) ;- extrinsic function
  1. ;----------------------------------------------------------------------------
  1. ; check integrity of a single global
  1. ; will stop if there are more than 999 errors with this global
  1. ;----------------------------------------------------------------------------
  1. Q:$G(VERSION)="" ""
  1. I VERSION<5.1 Q $$CheckGlobalIntegrity^%DM(DIRNAM,GLO,999,.GLOTOTBLKS,.GLOPNTBLKS,.GLOTOTBYTES,.GLOPNTBYTES,.GLOBIGBLKS,.GLOBIGBYTES,.GLOBIGSTRINGS,.DATASIZE)
  1. E Q $$CheckGlobalIntegrity^%SYS.DATABASE(DIRNAM,GLO,999,.GLOTOTBLKS,.GLOPNTBLKS,.GLOTOTBYTES,.GLOPNTBYTES,.GLOBIGBLKS,.GLOBIGBYTES,.GLOBIGSTRINGS,.DATASIZE)