KMPSGE ;SF/KAK - Master Routine ;27 AUG 97 1:12 pm
;;1.8;SAGG PROJECT;**1**;May 14, 1999
;
EN ; Routine can only be run as a TaskMan background job
;
Q:'$D(ZTQUEUED)
N KMPSVOLS
S U="^",KMPSX=$P($P(^%ZOSF("OS"),U),"("),KMPSX1=$S(KMPSX="VAX DSM":"VAX",KMPSX="MSM-PC/386":"MSM",KMPSX="MSM-PC/PLUS":"MSMV4",KMPSX="OpenM-NT":"OMNT",1:"ERR")
I KMPSX1="ERR" W !,"SAGG Project for this environment is NOT implemented !",*7,! K KMPSX,KMPSX1 Q
I KMPSX1="MSMV4" I $ZV["Windows NT" S KMPSX1="MSM"
S KMPSMGR=^%ZOSF("MGR"),KMPSPROD=$P(^%ZOSF("PROD"),","),KMPSPROD=$S($P(^KMPS(8970.1,1,0),"^",3)="":KMPSPROD,1:$P(^(0),"^",3))
S KMPSSITE=^DD("SITE",1),KMPSLOC=$P(^KMPS(8970.1,1,0),"^",2) D NOW^%DTC S KMPSDT=%
L +^XTMP("KMPS") S ^XTMP("KMPS",0)=%+10000
K ^XTMP("KMPS",KMPSSITE),^XTMP("KMPS","ERROR"),^XTMP("KMPS","START"),^XTMP("KMPS","STOP")
S NUM=+$H,^XTMP("KMPS",KMPSSITE,0)=NUM_U_KMPSX1_U_$P($T(+2),";",3)_" "_$P($T(+2),";",5)_U_+$G(^KMPS(8970.1,2,0))
S X="ERR1^KMPSGE",@^%ZOSF("TRAP")
S KMPSTEMP=KMPSSITE_U_NUM_U_KMPSLOC_U_KMPSDT_U_KMPSPROD
S (KMPSSTRT,KMPSVOL)=0 F S KMPSVOL=$O(^KMPS(8970.1,1,1,"B",KMPSVOL)) Q:KMPSVOL=""!+$G(^XTMP("KMPS","STOP")) D
.S KMPSUCIN=0 F S KMPSUCIN=$O(^KMPS(8970.1,1,1,"B",KMPSVOL,KMPSUCIN)) Q:KMPSUCIN="" D
..S KMPSUCI=$P(^KMPS(8970.1,1,1,KMPSUCIN,0),U,2)
..S:KMPSUCI="" KMPSUCI=KMPSPROD S KMPSVA(KMPSUCI_","_KMPSVOL)="",KMPSVOLS(KMPSVOL)=""
..D @KMPSX1 S KMPSSTRT=KMPSSTRT+1 I KMPSSTRT=6 D WAIT
;
LOOK ;
D ZER^KMPSLK
LOOP ;
; Wait for all volume sets to complete
;
H 300 I $D(^XTMP("KMPS","START")) G:(+$H<(NUM+3)) LOOP S KMPSTEXT(1)=" The SAGG Project collection routines have been running for more",KMPSTEXT(2)=" than 3 days. No report has been generated." G MSG^KMPSLK
K KMPSTEXT I $D(^XTMP("KMPS","ERROR")) S KMPSTEXT(1)=" The SAGG Project has recorded an error on volume set(s):" D G MSG^KMPSLK
.S KMPSX=0,KMPSVOL="" F S KMPSVOL=$O(^XTMP("KMPS","ERROR",KMPSVOL)) Q:KMPSVOL="" S:KMPSX KMPSTEXT(3)=KMPSTEXT(3)_" "_KMPSVOL S:'KMPSX KMPSX=1,KMPSTEXT(3)=" "_KMPSVOL
.S (KMPSTEXT(2),KMPSTEXT(4))="",KMPSTEXT(5)=" See system error log for more details."
.I KMPSX1="OMNT" S KMPSTEXT(6)="",KMPSTEXT(7)=" Also run INTEGRIT on the listed volume(s)."
I $D(^XTMP("KMPS","STOP")) S KMPSTEXT(1)=" The SAGG Project collection routines have been STOPPED! No report",KMPSTEXT(2)=" has been generated." G MSG^KMPSLK
I '$D(^XTMP("KMPS",KMPSSITE,NUM,KMPSDT)) D G MSG^KMPSLK
.S KMPSTEXT(1)=" The SAGG Project collection routines did NOT obtain ANY global",KMPSTEXT(2)=" information. Please ensure that the SAGG PROJECT file is"
.S KMPSTEXT(3)=" properly setup. Then use the 'One-time Option Queue' under",KMPSTEXT(4)=" Task Manager to re-run the KMPS SAGG REPORT option."
S KMPSX1="" F S KMPSX1=$O(^XTMP("KMPS",KMPSSITE,NUM,KMPSDT,KMPSX1)) Q:KMPSX1="" S KMPSX2="" F S KMPSX2=$O(^XTMP("KMPS",KMPSSITE,NUM,KMPSDT,KMPSX1,KMPSX2)) Q:KMPSX2="" K KMPSVA(KMPSX2)
S KMPSX1="" F S KMPSX1=$O(^XTMP("KMPS",KMPSSITE,NUM," NO GLOBALS ",KMPSX1)) Q:KMPSX1="" K KMPSVA(KMPSX1)
I $D(KMPSVA) S KMPSTEXT(1)=" The SAGG Project collection routines did NOT monitor the following:",KMPSTEXT(2)="" D G MSG^KMPSLK
.S KMPSX=0,KMPSX1="" F KMPSI=3:1 Q:KMPSX S KMPSTEXT(KMPSI)=" " F KMPSJ=1:1:5 S KMPSX1=$O(KMPSVA(KMPSX1)) S:KMPSX1="" KMPSX=1 Q:KMPSX1="" S KMPSTEXT(KMPSI)=KMPSTEXT(KMPSI)_KMPSX1_" "
.S KMPSTEXT(KMPSI)="",KMPSTEXT(KMPSI+1)=" Please ensure that the SAGG PROJECT file is properly setup. Then use"
.S KMPSTEXT(KMPSI+2)=" the 'One-time Option Queue' under Task Manager to re-run the KMPS SAGG",KMPSTEXT(KMPSI+3)=" REPORT option."
;
; PackMan ^XTMP global to KMP1-SAGG-SERVER at Albany CIOFO
;
S U="^",N=$O(^DIC(4,"D",KMPSSITE,0)),NM=$S($D(^DIC(4,N,0)):$P(^(0),"^"),1:KMPSSITE)
K XMY S:'$D(XMDUZ) XMDUZ=.5 S:'$D(DUZ) DUZ=.5
S XMSUB=NM_" (Session #"_NUM_") XTMP(""KMPS"") Global",XMTEXT="^XTMP(""KMPS"","_KMPSSITE_"," I $D(IO) K:IO="" IO
D ENT^XMPG S KMPSXMZ=XMZ K XMTEXT
S X="S.KMP1-SAGG-SERVER@DOMAIN.NAME",XMN=0 D INST^XMA21 D ENT1^XMD
;
G OUT^KMPSLK
;
WAIT ; Wait here until less than 6 volume sets are running
;
H 300 S KMPSCUR="",KMPSRUN=0 F S KMPSCUR=$O(^XTMP("KMPS","START",KMPSCUR)) Q:KMPSCUR="" S KMPSRUN=KMPSRUN+1
I KMPSRUN>5 G WAIT
S KMPSSTRT=KMPSRUN Q
ERR1 ;
S KMPSZE=$ZE,ZUZR=$ZR,X="",@^%ZOSF("TRAP") D @^%ZOSF("ERRTN") K KMPSTEXT S KMPSTEXT(1)="SAGG Project Error: "_KMPSZE_" on "_$ZU(5),KMPSTEXT(2)="See system error log for more details.",^XTMP("KMPS","STOP")="" D MSG^KMPSLK G ^XUSCLEAN
;
VAX ; DSM
J START^%ZOSVKSE:(OPTION="/ROUTINE=["_KMPSMGR_"]/UCI="_KMPSUCI_"/VOLUME="_KMPSVOL_"/DATA="""_KMPSTEMP_"""") Q
;
MSM ;
J START^%ZOSVKSE(KMPSTEMP)[KMPSUCI,KMPSVOL] Q
;
MSMV4 ;
S KMPSFS=$E(KMPSVOL)_"S"_$E(KMPSVOL,3)
J START^%ZOSVKSE(KMPSTEMP)[KMPSUCI,KMPSVOL,KMPSFS] Q
;
OMNT ; OpenM-NT
J START^%ZOSVKSE(KMPSTEMP_U_KMPSVOL) Q
KMPSGE ;SF/KAK - Master Routine ;27 AUG 97 1:12 pm
+1 ;;1.8;SAGG PROJECT;**1**;May 14, 1999
+2 ;
EN ; Routine can only be run as a TaskMan background job
+1 ;
+2 IF '$DATA(ZTQUEUED)
QUIT
+3 NEW KMPSVOLS
+4 SET U="^"
SET KMPSX=$PIECE($PIECE(^%ZOSF("OS"),U),"(")
SET KMPSX1=$SELECT(KMPSX="VAX DSM":"VAX",KMPSX="MSM-PC/386":"MSM",KMPSX="MSM-PC/PLUS":"MSMV4",KMPSX="OpenM-NT":"OMNT",1:"ERR")
+5 IF KMPSX1="ERR"
WRITE !,"SAGG Project for this environment is NOT implemented !",*7,!
KILL KMPSX,KMPSX1
QUIT
+6 IF KMPSX1="MSMV4"
IF $ZV["Windows NT"
SET KMPSX1="MSM"
+7 SET KMPSMGR=^%ZOSF("MGR")
SET KMPSPROD=$PIECE(^%ZOSF("PROD"),",")
SET KMPSPROD=$SELECT($PIECE(^KMPS(8970.1,1,0),"^",3)="":KMPSPROD,1:$PIECE(^(0),"^",3))
+8 SET KMPSSITE=^DD("SITE",1)
SET KMPSLOC=$PIECE(^KMPS(8970.1,1,0),"^",2)
DO NOW^%DTC
SET KMPSDT=%
+9 LOCK +^XTMP("KMPS")
SET ^XTMP("KMPS",0)=%+10000
+10 KILL ^XTMP("KMPS",KMPSSITE),^XTMP("KMPS","ERROR"),^XTMP("KMPS","START"),^XTMP("KMPS","STOP")
+11 SET NUM=+$HOROLOG
SET ^XTMP("KMPS",KMPSSITE,0)=NUM_U_KMPSX1_U_$PIECE($TEXT(+2),";",3)_" "_$PIECE($TEXT(+2),";",5)_U_+$GET(^KMPS(8970.1,2,0))
+12 SET X="ERR1^KMPSGE"
SET @^%ZOSF("TRAP")
+13 SET KMPSTEMP=KMPSSITE_U_NUM_U_KMPSLOC_U_KMPSDT_U_KMPSPROD
+14 SET (KMPSSTRT,KMPSVOL)=0
FOR
SET KMPSVOL=$ORDER(^KMPS(8970.1,1,1,"B",KMPSVOL))
IF KMPSVOL=""!+$GET(^XTMP("KMPS","STOP"))
QUIT
Begin DoDot:1
+15 SET KMPSUCIN=0
FOR
SET KMPSUCIN=$ORDER(^KMPS(8970.1,1,1,"B",KMPSVOL,KMPSUCIN))
IF KMPSUCIN=""
QUIT
Begin DoDot:2
+16 SET KMPSUCI=$PIECE(^KMPS(8970.1,1,1,KMPSUCIN,0),U,2)
+17 IF KMPSUCI=""
SET KMPSUCI=KMPSPROD
SET KMPSVA(KMPSUCI_","_KMPSVOL)=""
SET KMPSVOLS(KMPSVOL)=""
+18 DO @KMPSX1
SET KMPSSTRT=KMPSSTRT+1
IF KMPSSTRT=6
DO WAIT
End DoDot:2
End DoDot:1
+19 ;
LOOK ;
+1 DO ZER^KMPSLK
LOOP ;
+1 ; Wait for all volume sets to complete
+2 ;
+3 HANG 300
IF $DATA(^XTMP("KMPS","START"))
IF (+$HOROLOG<(NUM+3))
GOTO LOOP
SET KMPSTEXT(1)=" The SAGG Project collection routines have been running for more"
SET KMPSTEXT(2)=" than 3 days. No report has been generated."
GOTO MSG^KMPSLK
+4 KILL KMPSTEXT
IF $DATA(^XTMP("KMPS","ERROR"))
SET KMPSTEXT(1)=" The SAGG Project has recorded an error on volume set(s):"
Begin DoDot:1
+5 SET KMPSX=0
SET KMPSVOL=""
FOR
SET KMPSVOL=$ORDER(^XTMP("KMPS","ERROR",KMPSVOL))
IF KMPSVOL=""
QUIT
IF KMPSX
SET KMPSTEXT(3)=KMPSTEXT(3)_" "_KMPSVOL
IF 'KMPSX
SET KMPSX=1
SET KMPSTEXT(3)=" "_KMPSVOL
+6 SET (KMPSTEXT(2),KMPSTEXT(4))=""
SET KMPSTEXT(5)=" See system error log for more details."
+7 IF KMPSX1="OMNT"
SET KMPSTEXT(6)=""
SET KMPSTEXT(7)=" Also run INTEGRIT on the listed volume(s)."
End DoDot:1
GOTO MSG^KMPSLK
+8 IF $DATA(^XTMP("KMPS","STOP"))
SET KMPSTEXT(1)=" The SAGG Project collection routines have been STOPPED! No report"
SET KMPSTEXT(2)=" has been generated."
GOTO MSG^KMPSLK
+9 IF '$DATA(^XTMP("KMPS",KMPSSITE,NUM,KMPSDT))
Begin DoDot:1
+10 SET KMPSTEXT(1)=" The SAGG Project collection routines did NOT obtain ANY global"
SET KMPSTEXT(2)=" information. Please ensure that the SAGG PROJECT file is"
+11 SET KMPSTEXT(3)=" properly setup. Then use the 'One-time Option Queue' under"
SET KMPSTEXT(4)=" Task Manager to re-run the KMPS SAGG REPORT option."
End DoDot:1
GOTO MSG^KMPSLK
+12 SET KMPSX1=""
FOR
SET KMPSX1=$ORDER(^XTMP("KMPS",KMPSSITE,NUM,KMPSDT,KMPSX1))
IF KMPSX1=""
QUIT
SET KMPSX2=""
FOR
SET KMPSX2=$ORDER(^XTMP("KMPS",KMPSSITE,NUM,KMPSDT,KMPSX1,KMPSX2))
IF KMPSX2=""
QUIT
KILL KMPSVA(KMPSX2)
+13 SET KMPSX1=""
FOR
SET KMPSX1=$ORDER(^XTMP("KMPS",KMPSSITE,NUM," NO GLOBALS ",KMPSX1))
IF KMPSX1=""
QUIT
KILL KMPSVA(KMPSX1)
+14 IF $DATA(KMPSVA)
SET KMPSTEXT(1)=" The SAGG Project collection routines did NOT monitor the following:"
SET KMPSTEXT(2)=""
Begin DoDot:1
+15 SET KMPSX=0
SET KMPSX1=""
FOR KMPSI=3:1
IF KMPSX
QUIT
SET KMPSTEXT(KMPSI)=" "
FOR KMPSJ=1:1:5
SET KMPSX1=$ORDER(KMPSVA(KMPSX1))
IF KMPSX1=""
SET KMPSX=1
IF KMPSX1=""
QUIT
SET KMPSTEXT(KMPSI)=KMPSTEXT(KMPSI)_KMPSX1_" "
+16 SET KMPSTEXT(KMPSI)=""
SET KMPSTEXT(KMPSI+1)=" Please ensure that the SAGG PROJECT file is properly setup. Then use"
+17 SET KMPSTEXT(KMPSI+2)=" the 'One-time Option Queue' under Task Manager to re-run the KMPS SAGG"
SET KMPSTEXT(KMPSI+3)=" REPORT option."
End DoDot:1
GOTO MSG^KMPSLK
+18 ;
+19 ; PackMan ^XTMP global to KMP1-SAGG-SERVER at Albany CIOFO
+20 ;
+21 SET U="^"
SET N=$ORDER(^DIC(4,"D",KMPSSITE,0))
SET NM=$SELECT($DATA(^DIC(4,N,0)):$PIECE(^(0),"^"),1:KMPSSITE)
+22 KILL XMY
IF '$DATA(XMDUZ)
SET XMDUZ=.5
IF '$DATA(DUZ)
SET DUZ=.5
+23 SET XMSUB=NM_" (Session #"_NUM_") XTMP(""KMPS"") Global"
SET XMTEXT="^XTMP(""KMPS"","_KMPSSITE_","
IF $DATA(IO)
IF IO=""
KILL IO
+24 DO ENT^XMPG
SET KMPSXMZ=XMZ
KILL XMTEXT
+25 SET X="S.KMP1-SAGG-SERVER@DOMAIN.NAME"
SET XMN=0
DO INST^XMA21
DO ENT1^XMD
+26 ;
+27 GOTO OUT^KMPSLK
+28 ;
WAIT ; Wait here until less than 6 volume sets are running
+1 ;
+2 HANG 300
SET KMPSCUR=""
SET KMPSRUN=0
FOR
SET KMPSCUR=$ORDER(^XTMP("KMPS","START",KMPSCUR))
IF KMPSCUR=""
QUIT
SET KMPSRUN=KMPSRUN+1
+3 IF KMPSRUN>5
GOTO WAIT
+4 SET KMPSSTRT=KMPSRUN
QUIT
ERR1 ;
+1 SET KMPSZE=$ZE
SET ZUZR=$ZR
SET X=""
SET @^%ZOSF("TRAP")
DO @^%ZOSF("ERRTN")
KILL KMPSTEXT
SET KMPSTEXT(1)="SAGG Project Error: "_KMPSZE_" on "_$ZU(5)
SET KMPSTEXT(2)="See system error log for more details."
SET ^XTMP("KMPS","STOP")=""
DO MSG^KMPSLK
GOTO ^XUSCLEAN
+2 ;
VAX ; DSM
+1 JOB START^%ZOSVKSE:(OPTION="/ROUTINE=["_KMPSMGR_"]/UCI="_KMPSUCI_"/VOLUME="_KMPSVOL_"/DATA="""_KMPSTEMP_"""")
QUIT
+2 ;
MSM ;
+1 JOB START^%ZOSVKSE(KMPSTEMP)[KMPSUCI,KMPSVOL]
QUIT
+2 ;
MSMV4 ;
+1 SET KMPSFS=$EXTRACT(KMPSVOL)_"S"_$EXTRACT(KMPSVOL,3)
+2 JOB START^%ZOSVKSE(KMPSTEMP)[KMPSUCI,KMPSVOL,KMPSFS]
QUIT
+3 ;
OMNT ; OpenM-NT
+1 JOB START^%ZOSVKSE(KMPSTEMP_U_KMPSVOL)
QUIT