KMPSUTL ;SF/KAK - SAGG Utilities ;01 SEP 97 11:15 am
;;1.8;SAGG PROJECT;**1**;May 14, 1999
STAT ;
W !,?25,"SAGG Project Status",!,?29,"Version ",$P($T(+2),";",3),!,?(35-($L($P($T(+2),";",5))/2)),$P($T(+2),";",5),!
S U="^",KMPSX2=$P(^%ZOSF("PROD"),",")
S KMPSDA=0 I '$D(^DIC(19,"B","KMPS SAGG REPORT")) W !," The 'SAGG Master Background Task' option [KMPS SAGG REPORT] is missing !",*7,!
E S KMPSDA=$O(^DIC(19,"B","KMPS SAGG REPORT",0)),KMPSDA=+$O(^DIC(19.2,"B",KMPSDA,0)),KMPSX=$G(^DIC(19.2,KMPSDA,0)),Y=+$P(KMPSX,U,2) D:Y DD^%DT S $P(KMPSX,U,2)=Y
S KMPSTSK=+$G(^DIC(19.2,+KMPSDA,1))
W !,?5,"The 'SAGG Master Background Task' [KMPS SAGG REPORT] is ",$S('KMPSTSK:"NOT ",1:""),"scheduled",$S('KMPSTSK:".",1:""),!
I KMPSTSK D
.W ?5,"to run as Task ID ",KMPSTSK," on ",$S($P(KMPSX,U,2)="":"NO DATE",1:$P(KMPSX,U,2))
.S KMPSX=$P(KMPSX,U,6) W " every ",$S(KMPSX="":"UNKNOWN",1:+KMPSX)," ",$S(KMPSX["D":"day",KMPSX["M":"month",1:KMPSX)
.W:KMPSX>1 "s" W ".",!
D SYS
W !,?5,"SAGG Project collection routines will monitor the following:",!!,?7 S (KMPS,KMPSX)=0
F S KMPSX=$O(^KMPS(8970.1,1,1,"B",KMPSX)) Q:KMPSX="" D W:KMPS " - " W $S(KMPSSYS'="OMNT":KMPSX3_",",1:""),KMPSX S KMPS=KMPS+1 I KMPS=6 S KMPS=0 W !,?7
.S KMPSX3=$O(^KMPS(8970.1,1,1,"B",KMPSX,0)),KMPSX3=$P(^KMPS(8970.1,1,1,KMPSX3,0),U,2) S:KMPSX3="" KMPSX3=KMPSX2
D SYS
W ! I KMPSSYS'="OMNT" S KMPSX=$G(^KMPS(8970.1,1,0)) W !,?5,"XTMP(""KMPS"") Global Location: ",$S($P(KMPSX,U,3)="":KMPSX2,1:$P(KMPSX,U,3)),",",$S($P(KMPSX,U,2)="":"UNKNOWN",1:$P(KMPSX,U,2)),!
S KMPS=^DD("SITE",1)
W !,?5,"The temporary collection global (i.e., ^XTMP(""KMPS"")) has ",$S('$D(^XTMP("KMPS",KMPS)):"no ",1:""),"data.",!
I $D(^XTMP("KMPS",KMPS,0)) S %H=+^(0) W !,?5,"Session #",%H D YX^%DTC W " is running for ",Y,".",! I +$H-%H>1 W ?5,"This session has probably errored out.",!
I $D(^XTMP("KMPS","START")) W !,?5,"The SAGG Project routines are still running on:",!!,?7 S (KMPS,KMPSX)=0 F S KMPSX=$O(^XTMP("KMPS","START",KMPSX)) Q:KMPSX="" W:KMPS ", " W KMPSX S KMPS=KMPS+1 I KMPS=12 S KMPS=0 W !,?7
W ! I $D(^XTMP("KMPS","ERROR")) W !!,"Press <RETURN> to continue: " R X:DTIME G:'$T!(X["^") END W @IOF,!,?5,"The SAGG Project collection routines have recorded an error on",!,?5,"Volume Set(s):",!! D W !
.S KMPS=0,KMPSX="" F S KMPSX=$O(^XTMP("KMPS","ERROR",KMPSX)) Q:KMPSX="" W:KMPS ", " W:'KMPS ?7 W KMPSX S KMPS=1
I $D(^XTMP("KMPS","STOP")) W !,?5,"The SAGG Project collection routines have been informed to begin",!,?5,"an orderly shut-down process."
I $D(^XTMP("KMPS","STOP")),$D(^XTMP("KMPS","START")) W " The routines will stop running",!,?5,"after reaching the appropriate break-point."
W !!,"Press <RETURN> to continue: " R X:DTIME
END ;
K %,%H,KMPS,KMPSDA,KMPSSYS,KMPSX,KMPSX2,KMPSX3,X,Y Q
STOP ;
I '$D(^XTMP("KMPS","START")) W !,?5,"The SAGG Project collection routines have not started.",! Q
D STAT W !
S DIR("A")="Do you wish to manually STOP the SAGG Project collection routines (Y/N)",DIR("B")="N",DIR(0)="Y" D ^DIR W !
I Y S ^XTMP("KMPS","STOP")=1 W !,?5,"The SAGG Project collection routines have been notified to begin an",!,?5,"orderly shut-down process.",!
K DIR,X,Y Q
FILE ;
D SYS I KMPSSYS'="OMNT" D
.W !!,"Please specify the Volume Set and UCI which will hold"
.W !,"the ^XTMP(""KMPS"") global.",!
.S DIE="^KMPS(8970.1,",DLAYGO=8970.1,DA=1,DR=".02;.025" D ^DIE
W !!,"Specify the " W $S(KMPSSYS="VAX":"Volume Sets",1:"Directories")
W " which hold your VistA production globals:",!!,"For example:",!!,?10
I KMPSSYS="VAX" W "For DSM => ROU, VAA, VBB, VCC ... Vxx"
I KMPSSYS="MSM" W "For MSM => FDA, FDB, FDC ... FDx"
I KMPSSYS="OMNT" W "For OpenM-NT => W:\VAA, W:\VBB, W:\VCC ... V:\Vxx"
I KMPSSYS="UNKWN" W "Specify all locations of VistA globals"
W !!,"Do NOT specify 'scratch/test/training' " W $S(KMPSSYS="VAX":"Volume Sets",1:"Directories")
W " (i.e., ZAA, UTL," W !,"TST, etc.).",!
S DIE="^KMPS(8970.1,",DA=1,DR=.03 S:KMPSSYS="OMNT" DR(2,8970.11)=.01 D ^DIE
K DA,DIC,DIE,DLAYGO,DR,KMPSSYS Q
MAIL ;
W !!,"Specify the users that will receive SAGG notification messages.",!
S (DIC,DIE)="^XMB(3.8,",DIC(0)="LZ",DLAYGO=3.8,X="KMPS-SAGG" D ^DIC
S DA=+Y,DR=2 D ^DIE
K DA,DIC,DIE,DLAYGO,DR,X,Y Q
SYS ;
S KMPSSYS=$P($P(^%ZOSF("OS"),U),"("),KMPSSYS=$S(KMPSSYS="VAX DSM":"VAX",KMPSSYS["MSM-PC":"MSM",KMPSSYS="OpenM-NT":"OMNT",1:"UNKWN")
Q
KMPSUTL ;SF/KAK - SAGG Utilities ;01 SEP 97 11:15 am
+1 ;;1.8;SAGG PROJECT;**1**;May 14, 1999
STAT ;
+1 WRITE !,?25,"SAGG Project Status",!,?29,"Version ",$PIECE($TEXT(+2),";",3),!,?(35-($LENGTH($PIECE($TEXT(+2),";",5))/2)),$PIECE($TEXT(+2),";",5),!
+2 SET U="^"
SET KMPSX2=$PIECE(^%ZOSF("PROD"),",")
+3 SET KMPSDA=0
IF '$DATA(^DIC(19,"B","KMPS SAGG REPORT"))
WRITE !," The 'SAGG Master Background Task' option [KMPS SAGG REPORT] is missing !",*7,!
+4 IF '$TEST
SET KMPSDA=$ORDER(^DIC(19,"B","KMPS SAGG REPORT",0))
SET KMPSDA=+$ORDER(^DIC(19.2,"B",KMPSDA,0))
SET KMPSX=$GET(^DIC(19.2,KMPSDA,0))
SET Y=+$PIECE(KMPSX,U,2)
IF Y
DO DD^%DT
SET $PIECE(KMPSX,U,2)=Y
+5 SET KMPSTSK=+$GET(^DIC(19.2,+KMPSDA,1))
+6 WRITE !,?5,"The 'SAGG Master Background Task' [KMPS SAGG REPORT] is ",$SELECT('KMPSTSK:"NOT ",1:""),"scheduled",$SELECT('KMPSTSK:".",1:""),!
+7 IF KMPSTSK
Begin DoDot:1
+8 WRITE ?5,"to run as Task ID ",KMPSTSK," on ",$SELECT($PIECE(KMPSX,U,2)="":"NO DATE",1:$PIECE(KMPSX,U,2))
+9 SET KMPSX=$PIECE(KMPSX,U,6)
WRITE " every ",$SELECT(KMPSX="":"UNKNOWN",1:+KMPSX)," ",$SELECT(KMPSX["D":"day",KMPSX["M":"month",1:KMPSX)
+10 IF KMPSX>1
WRITE "s"
WRITE ".",!
End DoDot:1
+11 DO SYS
+12 WRITE !,?5,"SAGG Project collection routines will monitor the following:",!!,?7
SET (KMPS,KMPSX)=0
+13 FOR
SET KMPSX=$ORDER(^KMPS(8970.1,1,1,"B",KMPSX))
IF KMPSX=""
QUIT
Begin DoDot:1
+14 SET KMPSX3=$ORDER(^KMPS(8970.1,1,1,"B",KMPSX,0))
SET KMPSX3=$PIECE(^KMPS(8970.1,1,1,KMPSX3,0),U,2)
IF KMPSX3=""
SET KMPSX3=KMPSX2
End DoDot:1
IF KMPS
WRITE " - "
WRITE $SELECT(KMPSSYS'="OMNT":KMPSX3_",",1:""),KMPSX
SET KMPS=KMPS+1
IF KMPS=6
SET KMPS=0
WRITE !,?7
+15 DO SYS
+16 WRITE !
IF KMPSSYS'="OMNT"
SET KMPSX=$GET(^KMPS(8970.1,1,0))
WRITE !,?5,"XTMP(""KMPS"") Global Location: ",$SELECT($PIECE(KMPSX,U,3)="":KMPSX2,1:$PIECE(KMPSX,U,3)),",",$SELECT($PIECE(KMPSX,U,2)="":"UNKNOWN",1:$PIECE(KMPSX,U,2)),!
+17 SET KMPS=^DD("SITE",1)
+18 WRITE !,?5,"The temporary collection global (i.e., ^XTMP(""KMPS"")) has ",$SELECT('$DATA(^XTMP("KMPS",KMPS)):"no ",1:""),"data.",!
+19 IF $DATA(^XTMP("KMPS",KMPS,0))
SET %H=+^(0)
WRITE !,?5,"Session #",%H
DO YX^%DTC
WRITE " is running for ",Y,".",!
IF +$HOROLOG-%H>1
WRITE ?5,"This session has probably errored out.",!
+20 IF $DATA(^XTMP("KMPS","START"))
WRITE !,?5,"The SAGG Project routines are still running on:",!!,?7
SET (KMPS,KMPSX)=0
FOR
SET KMPSX=$ORDER(^XTMP("KMPS","START",KMPSX))
IF KMPSX=""
QUIT
IF KMPS
WRITE ", "
WRITE KMPSX
SET KMPS=KMPS+1
IF KMPS=12
SET KMPS=0
WRITE !,?7
+21 WRITE !
IF $DATA(^XTMP("KMPS","ERROR"))
WRITE !!,"Press <RETURN> to continue: "
READ X:DTIME
IF '$TEST!(X["^")
GOTO END
WRITE @IOF,!,?5,"The SAGG Project collection routines have recorded an error on",!,?5,"Volume Set(s):",!!
Begin DoDot:1
+22 SET KMPS=0
SET KMPSX=""
FOR
SET KMPSX=$ORDER(^XTMP("KMPS","ERROR",KMPSX))
IF KMPSX=""
QUIT
IF KMPS
WRITE ", "
IF 'KMPS
WRITE ?7
WRITE KMPSX
SET KMPS=1
End DoDot:1
WRITE !
+23 IF $DATA(^XTMP("KMPS","STOP"))
WRITE !,?5,"The SAGG Project collection routines have been informed to begin",!,?5,"an orderly shut-down process."
+24 IF $DATA(^XTMP("KMPS","STOP"))
IF $DATA(^XTMP("KMPS","START"))
WRITE " The routines will stop running",!,?5,"after reaching the appropriate break-point."
+25 WRITE !!,"Press <RETURN> to continue: "
READ X:DTIME
END ;
+1 KILL %,%H,KMPS,KMPSDA,KMPSSYS,KMPSX,KMPSX2,KMPSX3,X,Y
QUIT
STOP ;
+1 IF '$DATA(^XTMP("KMPS","START"))
WRITE !,?5,"The SAGG Project collection routines have not started.",!
QUIT
+2 DO STAT
WRITE !
+3 SET DIR("A")="Do you wish to manually STOP the SAGG Project collection routines (Y/N)"
SET DIR("B")="N"
SET DIR(0)="Y"
DO ^DIR
WRITE !
+4 IF Y
SET ^XTMP("KMPS","STOP")=1
WRITE !,?5,"The SAGG Project collection routines have been notified to begin an",!,?5,"orderly shut-down process.",!
+5 KILL DIR,X,Y
QUIT
FILE ;
+1 DO SYS
IF KMPSSYS'="OMNT"
Begin DoDot:1
+2 WRITE !!,"Please specify the Volume Set and UCI which will hold"
+3 WRITE !,"the ^XTMP(""KMPS"") global.",!
+4 SET DIE="^KMPS(8970.1,"
SET DLAYGO=8970.1
SET DA=1
SET DR=".02;.025"
DO ^DIE
End DoDot:1
+5 WRITE !!,"Specify the "
WRITE $SELECT(KMPSSYS="VAX":"Volume Sets",1:"Directories")
+6 WRITE " which hold your VistA production globals:",!!,"For example:",!!,?10
+7 IF KMPSSYS="VAX"
WRITE "For DSM => ROU, VAA, VBB, VCC ... Vxx"
+8 IF KMPSSYS="MSM"
WRITE "For MSM => FDA, FDB, FDC ... FDx"
+9 IF KMPSSYS="OMNT"
WRITE "For OpenM-NT => W:\VAA, W:\VBB, W:\VCC ... V:\Vxx"
+10 IF KMPSSYS="UNKWN"
WRITE "Specify all locations of VistA globals"
+11 WRITE !!,"Do NOT specify 'scratch/test/training' "
WRITE $SELECT(KMPSSYS="VAX":"Volume Sets",1:"Directories")
+12 WRITE " (i.e., ZAA, UTL,"
WRITE !,"TST, etc.).",!
+13 SET DIE="^KMPS(8970.1,"
SET DA=1
SET DR=.03
IF KMPSSYS="OMNT"
SET DR(2,8970.11)=.01
DO ^DIE
+14 KILL DA,DIC,DIE,DLAYGO,DR,KMPSSYS
QUIT
MAIL ;
+1 WRITE !!,"Specify the users that will receive SAGG notification messages.",!
+2 SET (DIC,DIE)="^XMB(3.8,"
SET DIC(0)="LZ"
SET DLAYGO=3.8
SET X="KMPS-SAGG"
DO ^DIC
+3 SET DA=+Y
SET DR=2
DO ^DIE
+4 KILL DA,DIC,DIE,DLAYGO,DR,X,Y
QUIT
SYS ;
+1 SET KMPSSYS=$PIECE($PIECE(^%ZOSF("OS"),U),"(")
SET KMPSSYS=$SELECT(KMPSSYS="VAX DSM":"VAX",KMPSSYS["MSM-PC":"MSM",KMPSSYS="OpenM-NT":"OMNT",1:"UNKWN")
+2 QUIT