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

ZOSVKSOE.m

Go to the documentation of this file.
  1. %ZOSVKSE ;OAK/KAK/RAK/JML - ZOSVKSOE - Global data (Cache) ;9/1/2015
  1. ;;8.0;KERNEL;**90,94,197,268,456,568**;Jul 26, 2004;Build 48
  1. ;
  1. Q
  1. ;
  1. START(KMPSTEMP) ;-- called by routine CVMS+2^KMPSGE/CWINNT+1^KMPSGE in VAH
  1. ;------------------------------------------------------------------------
  1. ; KMPSTEMP... ^ piece 1: SiteNumber
  1. ; piece 2: SessionNumber
  1. ; piece 3: XTMP Global Location
  1. ; piece 4: Current Date/Time
  1. ; piece 5: Production UCI
  1. ; piece 6: Volume set
  1. ;-------------------------------------------------------------------------
  1. ;
  1. Q:$G(KMPSTEMP)=""
  1. ;
  1. N KMPSDT,KMPSERR,KMPSERR1,KMPSERR2,KMPSERR3,KMPSERR4
  1. N KMPSLOC,KMPSPROD,KMPSSITE,KMPSVOL,KMPSZU,NUM,X,VERSION,ZV
  1. ;
  1. I $$NEWERR^%ZTER N $ETRAP,$ESTACK S $ETRAP="D ERROR^%ZOSVKSE"
  1. E S X="ERROR^%ZOSVKSE",@^%ZOSF("TRAP")
  1. ;
  1. S U="^",KMPSSITE=$P(KMPSTEMP,U),NUM=$P(KMPSTEMP,U,2),KMPSLOC=$P(KMPSTEMP,U,3)
  1. S KMPSDT=$P(KMPSTEMP,U,4),KMPSPROD=$P(KMPSTEMP,U,5),KMPSVOL=$P(KMPSTEMP,U,6)
  1. K KMPSTEMP
  1. S KMPSZU=$ZNSPACE_","_KMPSVOL
  1. S ^XTMP("KMPS","START",KMPSVOL,NUM)=$H
  1. S VERSION=$$VERSION^%ZOSV ; IA# 10097
  1. I VERSION<2008 D DONE Q
  1. ;
  1. ; version
  1. S ZV=$P($$VERSION^%ZOSV(1),"/") ; IA# 10097
  1. ;
  1. ; check for accepted operating system
  1. Q:'$$OSOKAY(ZV)
  1. ;
  1. D ALLOS
  1. ;
  1. DONE ; normal exit
  1. ;
  1. K ^XTMP("KMPS","START",KMPSVOL)
  1. ;
  1. Q
  1. ;
  1. ALLOS ;-- entry point now for all OS's
  1. ;
  1. N GLOARRAY,RC
  1. ;
  1. ; set up GLOARRAY array indexed by global name
  1. S RC=$$GetDirGlobals^%SYS.DATABASE(KMPSVOL,.GLOARRAY)
  1. ;
  1. I ('+RC) D ERRVMS G ERROR
  1. ;
  1. I '$D(GLOARRAY) S ^XTMP("KMPS",KMPSSITE,NUM," NO GLOBALS ",KMPSVOL)="" Q
  1. ;
  1. D ALLGLO
  1. ;
  1. Q
  1. ;
  1. ALLGLO ;- collect global info
  1. ;
  1. N COLLATE,DATASIZE,FBLK,GLO,GLOINFO,GLOTOTBLKS,GLOPNTBLKS,GLOTOTBYTES
  1. N GLOPNTBYTES,GLOBIGBLKS,GLOBIGBYTES,GLOBIGSTRINGS,GRWBLK
  1. N I,INFO,JRNL,LEV,MSGLIST,PROT,PROTECT,PROTINFO,RC,TPTRBLK,TRY
  1. ;
  1. S GLO="",RC=1
  1. S PROT(0)="N",PROT(1)="R",PROT(2)="RW",PROT(3)="RWD"
  1. ;
  1. F S GLO=$O(GLOARRAY(GLO)) Q:GLO=""!+$G(^XTMP("KMPS","STOP")) D Q:+$G(^XTMP("KMPS","STOP"))!('+RC)
  1. .;
  1. .S (COLLATE,FBLK,GRWBLK,JRNL,PROTECT,TPTRBLK)=""
  1. .S PROTINFO="^^^"
  1. .;
  1. .; global info - '^' delimited
  1. .; piece 1: first block
  1. .; piece 2: jrnl^collate
  1. .; piece 3: bits(blank)
  1. .; piece 4: growth area block
  1. .; piece 5: protection:system(blank)
  1. .; piece 6: protection:world
  1. .; piece 7: group^owner
  1. .; piece 8: network^top (first) pointer block
  1. .S GLOINFO=FBLK_U_JRNL_U_COLLATE_"^^"_GRWBLK_"^^"_PROTINFO_U_TPTRBLK
  1. .;
  1. .S ^XTMP("KMPS",KMPSSITE,NUM,KMPSDT,GLO,KMPSZU)=GLOINFO
  1. .;
  1. .; get global total blocks.... GLOTOTBLKS
  1. .; global pointer blocks.. GLOPNTBLKS
  1. .; global total bytes..... GLOTOTBYTES
  1. .; global pointer bytes... GLOPNTBYTE
  1. .; global big blocks...... GLOBIGBLKS
  1. .; global big bytes....... GLOBIGBYTES
  1. .; global big strings..... GLOBIGSTRINGS
  1. .; data size.............. DATASIZE
  1. .; will stop if there are more than 999 errors with this global
  1. .S RC=$$CheckGlobalIntegrity^%SYS.DATABASE(KMPSVOL,GLO,999,.GLOTOTBLKS,.GLOPNTBLKS,.GLOTOTBYTES,.GLOPNTBYTES,.GLOBIGBLKS,.GLOBIGBYTES,.GLOBIGSTRINGS,.DATASIZE)
  1. .;
  1. .K MSGLIST
  1. .D DecomposeStatus^%SYS.DATABASE(RC,.MSGLIST,0,"")
  1. .;
  1. .S (LEV,RC)=1
  1. .F I=1:1:MSGLIST D
  1. ..S INFO=MSGLIST(I),BLK=$$BLK(INFO),EFF=$$EFF(INFO)
  1. ..;
  1. ..; more than 999 errors reported
  1. ..I INFO["***Further checking of this global is aborted." S RC=0 D ERRVMS Q
  1. ..;
  1. ..I ($P(INFO,":")["Top Pointer Level")!($P(INFO,":")["Top/Bottom Pnt Level") D Q
  1. ...S ^XTMP("KMPS",KMPSSITE,NUM,GLO,KMPSZU,KMPSDT,1)=BLK_"^"_EFF_"%^Pointer"
  1. ..I $P(INFO,":")["Pointer Level" D Q
  1. ...S LEV=LEV+1,^XTMP("KMPS",KMPSSITE,NUM,GLO,KMPSZU,KMPSDT,LEV)=BLK_"^"_EFF_"%^Pointer"
  1. ..I $P(INFO,":")["Bottom Pointer Level" D Q
  1. ...S LEV=LEV+1,^XTMP("KMPS",KMPSSITE,NUM,GLO,KMPSZU,KMPSDT,LEV)=BLK_"^"_EFF_"%^Bottom pointer"
  1. ..I $P(INFO,":")["Data Level" D Q
  1. ...S ^XTMP("KMPS",KMPSSITE,NUM,GLO,KMPSZU,KMPSDT,"D")=BLK_"^"_EFF_"%^Data"
  1. ..I $P(INFO,":")["Big Strings" D Q
  1. ...S ^XTMP("KMPS",KMPSSITE,NUM,GLO,KMPSZU,KMPSDT,"L")=BLK_"^"_EFF_"%^LongString"
  1. ;
  1. I ('+RC) G ERROR
  1. ;
  1. Q
  1. ;
  1. BLK(STRNG) ;-- function to obtain number of blocks from input string
  1. ;
  1. N BLK
  1. Q:$G(STRNG)="" ""
  1. S BLK=$$NOCOMMA($P($P(STRNG,"=",2)," "))
  1. Q BLK
  1. ;
  1. EFF(STRNG) ;-- function to obtain efficiency from input string
  1. ;
  1. N EFF
  1. Q:$G(STRNG)="" ""
  1. S EFF=$P($P(STRNG,"%"),"(",2)
  1. Q EFF
  1. ;
  1. NOCOMMA(IN) ;-- strip comma from input string
  1. ;
  1. Q $TR(IN,",","")
  1. ;
  1. ERRVMS ;
  1. S $ZE="<ERROR>UC1VMS+6^%ZOSVKSE"
  1. I '+RC S KMPSERR1="ERROR: Cannot find global names for "_KMPSVOL
  1. Q
  1. ;
  1. OSOKAY(ZV) ;-- extrinsic function - operating system ok for SAGG
  1. ;---------------------------------------------------------------
  1. ; ZV - Operating system
  1. ;
  1. ; Return: 1 - os is okay for sagg
  1. ; "" - os not okay
  1. ;---------------------------------------------------------------
  1. ;
  1. Q:$G(ZV)="" ""
  1. Q:ZV="Cache for OpenVMS" 1
  1. Q:$E(ZV,1,14)="Cache for UNIX" 1
  1. Q:$E(ZV,1,17)="Cache for Windows" 1
  1. Q ""
  1. ;
  1. ERROR ; ERROR - Tell all SAGG jobs to STOP collection
  1. ;
  1. C 63
  1. S KMPSERR="Error encountered while running SAGG collection routine for volume set "_$G(KMPSVOL)
  1. S KMPSERR2="Last global reference = "_$ZR
  1. S KMPSERR3="Error code = "_$$EC^%ZOSV ; IA# 10097
  1. I $D(KMPSERR4) S KMPSERR4="For more information, read text at line tag "_KMPSERR4_" in routine ^%ZOSVKSS"
  1. ;
  1. S ^XTMP("KMPS","ERROR",KMPSVOL)="",^XTMP("KMPS","STOP")=1
  1. K ^XTMP("KMPS","START",KMPSVOL)
  1. ;
  1. D ^%ZTER,UNWIND^%ZTER
  1. ;
  1. Q