XTINITY ;ISC-SF.SEA/JLI - SEND INSTALL MESSAGE, SETUP IF ALPHA/BETA TEST SITE ;12/16/93 14:04 ;
VER ;;7.3;TOOLKIT;;Apr 25, 1995
N DIFROM
S XQABT5=$H X ^%ZOSF("UCI") I Y'=^%ZOSF("PROD") G KILL
S X=$T(ADRESS) Q:X="" S XQADRS=$P(X,";",3) G:XQADRS="" KILL G:XQADRS'["@" KILL
S X=$T(VERS) S XQVERS=$S(X="":$P($T(VER),";",3),1:X)
S X=$T(PKGNAM),(X,XQPKG)=$P(X,";",3) G:X="" KILL
S DIC(0)="MX",DIC="^XMB(1,1,""ABPKG"",",DA(1)=1,D0=1 D ^DIC S XQDA=+Y K DIC
S Y=$T(ABTEST) I $P(Y,";",3)'["YES" D:XQDA>0 RMVTEST G SENDMESG
D:XQDA>0 CLROPTS I XQDA'>0 S DA(1)=1,D0=1,DIC(0)="L",DLAYGO=4.3,DIC="^XMB(1,1,""ABPKG"",",DIC("P")=4.332 D ^DIC S XQDA=+Y
D:XQDA>0 SETOPTS
;
SENDMESG ;
S X=$T(SENMSG) I $P(X,";",3)'="YES" G KILL
K ^TMP($J,"XQAB") D NOW^%DTC
S ^TMP($J,"XQAB",1)="INSTALLED V. "_XQVERS_" "_$E(%,4,5)_"/"_$E(%,6,7)_"/"_$E(%,2,3)_" "_$E(%_"000",9,10)_":"_$E(%_"00000",11,12)
S (X1,X2,X3)=0 I $D(XQABT1),$D(XQABT2) S X1=$P(XQABT2,",",2)-$P(XQABT1,",",2)
I $D(XQABT4),$D(XQABT3) S X2=$P(XQABT4,",",2)-$P(XQABT3,",",2)
I $D(XQABT4),$D(XQABT5) S X3=$P(XQABT5,",",2)-$P(XQABT4,",",2)
S:X1'=0 ^TMP($J,"XQAB",2)=" PRE-INIT TIME = "_X1_" SECONDS" S:X2'=0 ^(3)=" INIT TIME = "_X2_" SECONDS" S:X3'=0 ^(4)=" POST-INIT TIME = "_X3_" SECONDS"
S XMY(XQADRS)="",XMY(DUZ)="",XMDUZ=.5,XMSUB=XQPKG_" "_XQVERS_" INSTALLATION",XMTEXT="^TMP($J,""XQAB""," D ^XMD K ^TMP($J,"XQAB"),XMY,XMDUZ,XMSUB,XMTEXT
;
KILL K %,DA,DIC,DIE,DIK,DLAYGO,DR,X,X1,X2,X3,XQ0,XQ1,XQ2,XQ3,XQ4,XQA,XQADRS,XQB,XQBLNK,XQC,XQD1,XQDA,XQI,XQID,XQJ,XQN,XQPKG,XQZ,XQABT1,XQABT2,XQABT3,XQABT4,XQABT5
Q
Q
;
SETOPTS ;
S $P(^XMB(1,1,"ABPKG",XQDA,0),U,2,4)=DT_U_XQADRS_U_XQVERS
F XQI=1:1 S XQA="OPT"_XQI,XQB=$T(@XQA) Q:XQB="" S X=$P(XQB,";",3),DIC="^XMB(1,1,""ABPKG"",XQDA,1,",DA(1)=XQDA,DA(2)=1,DIC(0)="ML",DLAYGO=4.3,DIC("P")=4.3321 D ^DIC K DIC I Y>0 K XQID(X) D SET1
S XQID="" F XQI=0:0 S XQID=$O(XQID(XQID)) Q:XQID="" S DIC="^XMB(1,1,""ABPKG"",XQDA,1,",DIC(0)="M",X=XQID,DA(1)=XQDA,DA(2)=1 K XQID(XQID) D ^DIC I Y>0 S DA=+Y,DIE=DIC,DR=".01///@" D ^DIE
Q
SET1 ;
S XQD1=+Y F XQJ=4:1 S X=$P(XQB,";",XQJ) Q:X="" S DIC="^XMB(1,1,""ABPKG"",XQDA,1,XQD1,1,",DIC(0)="ML",DLAYGO=4.3,DIC("P")=4.33211,DA(3)=1,DA(2)=XQDA,DA(1)=XQD1 D ^DIC K DIC
Q
;
RMVTEST D CLROPTS S DIK="^XMB(1,1,""ABPKG"",",DA(1)=1,DA=XQDA D ^DIK I $O(^XMB(1,1,"ABPKG",0))'>0 K ^XMB(1,1,"ABOPT")
Q
;
CLROPTS S $P(XQBLNK," ",30)=" "
K ^TMP($J,"XQAB"),^("XQOPT")
S X1=$P(^XMB(1,1,"ABPKG",XQDA,0),U,2),X2=$P(^(0),U,3),X3=$P(^(0),U,4),X3=$S(X3="":$E(XQVERS,1,$L(XQVERS)-1)_($E(XQVERS,$L(XQVERS))-1),1:X3)
S ^TMP($J,"XQAB",1)=" "_XQPKG_" v"_X3_" OPTION USAGE SINCE "_$E(X1,4,5)_"-"_$E(X1,6,7)_"-"_$E(X1,2,3),^(2)=" ",XQC=2 D GETDATA I $D(^TMP($J,"XQOPT")) D OUTPUT
Q
GETDATA ;
F XQ1=0:0 S XQ1=$O(^XMB(1,1,"ABPKG",XQDA,1,XQ1)) Q:XQ1'>0 S XQID=$P(^(XQ1,0),U),XQID(XQID)="" D CHECK
Q
;
CHECK S XQA=$E(XQID,1,$L(XQID)-1)_$C($A($E(XQID,$L(XQID)))-1)_"z"
F XQ2=0:0 S XQA=$O(^DIC(19,"B",XQA)) Q:XQA=""!($E(XQA,1,$L(XQID))'=XQID) I $E(XQA,$L(XQID)+1)'="Z" D CHK2
Q
;
CHK2 F XQ3=0:0 S XQ3=$O(^XMB(1,1,"ABPKG",XQDA,1,XQ1,1,XQ3)) Q:XQ3'>0 S XQ4=$P(^(XQ3,0),U) Q:$E(XQA,1,$L(XQ4))=XQ4
I XQ3'>0 F XQ4=0:0 S XQ4=$O(^DIC(19,"B",XQA,XQ4)) Q:XQ4'>0 S XQN=$P(^DIC(19,XQ4,0),U,1,4),X=$S($D(^XMB(1,1,"ABOPT",XQ4,0)):+$P(^(0),U,2),1:0) K ^XMB(1,1,"ABOPT",XQ4,0) S ^TMP($J,"XQOPT",XQID,(X+1),XQA,XQ4)=XQ4_U_X_U_XQN
Q
;
OUTPUT S XQID=""
F XQ0=0:0 S XQID=$O(^TMP($J,"XQOPT",XQID)) Q:XQID="" D SPACE F XQ1=0:0 S XQ1=$O(^TMP($J,"XQOPT",XQID,XQ1)) Q:XQ1'>0 S XQA="" F XQ2=0:0 S XQA=$O(^TMP($J,"XQOPT",XQID,XQ1,XQA)) Q:XQA="" D OUTA
S XMY(XQADRS)="",XMY(DUZ)="",XMDUZ=.5,XMSUB=XQPKG_" "_XQ3_" ALPHA/BETA TEST OPTION USAGE",XMTEXT="^TMP($J,""XQAB""," D ^XMD K ^TMP($J,"XQAB"),^("XQOPT"),XMY,XMDUZ,XMSUB,XMTEXT
Q
Q
;
SPACE S XQC=XQC+1,^TMP($J,"XQAB",XQC)=" "
Q
OUTA ;
F XQ3=0:0 S XQ3=$O(^TMP($J,"XQOPT",XQID,XQ1,XQA,XQ3)) Q:XQ3'>0 S X=^(XQ3),XQZ=$P(X,U,2),Y=$P(X,U,3,99) D MAIL
Q
MAIL ;
S XQC=XQC+1,^TMP($J,"XQAB",XQC)=$E($E($P(Y,U),1,24)_XQBLNK,1,26)_$P(Y,U,4)_" "_$J(+XQZ,6)_" "_$E($P(Y,U,2),1,38)
Q
;
PKGNAM ;;TOOLKIT;
ABTEST ;;NO;
ADRESS ;;G.KERNEL DEVELOPERS@DOMAIN.NAME;
SENMSG ;;YES;
XTINITY ;ISC-SF.SEA/JLI - SEND INSTALL MESSAGE, SETUP IF ALPHA/BETA TEST SITE ;12/16/93 14:04 ;
VER ;;7.3;TOOLKIT;;Apr 25, 1995
+1 NEW DIFROM
+2 SET XQABT5=$HOROLOG
XECUTE ^%ZOSF("UCI")
IF Y'=^%ZOSF("PROD")
GOTO KILL
+3 SET X=$TEXT(ADRESS)
IF X=""
QUIT
SET XQADRS=$PIECE(X,";",3)
IF XQADRS=""
GOTO KILL
IF XQADRS'["@"
GOTO KILL
+4 SET X=$TEXT(VERS)
SET XQVERS=$SELECT(X="":$PIECE($TEXT(VER),";",3),1:X)
+5 SET X=$TEXT(PKGNAM)
SET (X,XQPKG)=$PIECE(X,";",3)
IF X=""
GOTO KILL
+6 SET DIC(0)="MX"
SET DIC="^XMB(1,1,""ABPKG"","
SET DA(1)=1
SET D0=1
DO ^DIC
SET XQDA=+Y
KILL DIC
+7 SET Y=$TEXT(ABTEST)
IF $PIECE(Y,";",3)'["YES"
IF XQDA>0
DO RMVTEST
GOTO SENDMESG
+8 IF XQDA>0
DO CLROPTS
IF XQDA'>0
SET DA(1)=1
SET D0=1
SET DIC(0)="L"
SET DLAYGO=4.3
SET DIC="^XMB(1,1,""ABPKG"","
SET DIC("P")=4.332
DO ^DIC
SET XQDA=+Y
+9 IF XQDA>0
DO SETOPTS
+10 ;
SENDMESG ;
+1 SET X=$TEXT(SENMSG)
IF $PIECE(X,";",3)'="YES"
GOTO KILL
+2 KILL ^TMP($JOB,"XQAB")
DO NOW^%DTC
+3 SET ^TMP($JOB,"XQAB",1)="INSTALLED V. "_XQVERS_" "_$EXTRACT(%,4,5)_"/"_$EXTRACT(%,6,7)_"/"_$EXTRACT(%,2,3)_" "_$EXTRACT(%_"000",9,10)_":"_$EXTRACT(%_"00000",11,12)
+4 SET (X1,X2,X3)=0
IF $DATA(XQABT1)
IF $DATA(XQABT2)
SET X1=$PIECE(XQABT2,",",2)-$PIECE(XQABT1,",",2)
+5 IF $DATA(XQABT4)
IF $DATA(XQABT3)
SET X2=$PIECE(XQABT4,",",2)-$PIECE(XQABT3,",",2)
+6 IF $DATA(XQABT4)
IF $DATA(XQABT5)
SET X3=$PIECE(XQABT5,",",2)-$PIECE(XQABT4,",",2)
+7 IF X1'=0
SET ^TMP($JOB,"XQAB",2)=" PRE-INIT TIME = "_X1_" SECONDS"
IF X2'=0
SET ^(3)=" INIT TIME = "_X2_" SECONDS"
IF X3'=0
SET ^(4)=" POST-INIT TIME = "_X3_" SECONDS"
+8 SET XMY(XQADRS)=""
SET XMY(DUZ)=""
SET XMDUZ=.5
SET XMSUB=XQPKG_" "_XQVERS_" INSTALLATION"
SET XMTEXT="^TMP($J,""XQAB"","
DO ^XMD
KILL ^TMP($JOB,"XQAB"),XMY,XMDUZ,XMSUB,XMTEXT
+9 ;
KILL KILL %,DA,DIC,DIE,DIK,DLAYGO,DR,X,X1,X2,X3,XQ0,XQ1,XQ2,XQ3,XQ4,XQA,XQADRS,XQB,XQBLNK,XQC,XQD1,XQDA,XQI,XQID,XQJ,XQN,XQPKG,XQZ,XQABT1,XQABT2,XQABT3,XQABT4,XQABT5
+1 QUIT
+2 QUIT
+3 ;
SETOPTS ;
+1 SET $PIECE(^XMB(1,1,"ABPKG",XQDA,0),U,2,4)=DT_U_XQADRS_U_XQVERS
+2 FOR XQI=1:1
SET XQA="OPT"_XQI
SET XQB=$TEXT(@XQA)
IF XQB=""
QUIT
SET X=$PIECE(XQB,";",3)
SET DIC="^XMB(1,1,""ABPKG"",XQDA,1,"
SET DA(1)=XQDA
SET DA(2)=1
SET DIC(0)="ML"
SET DLAYGO=4.3
SET DIC("P")=4.3321
DO ^DIC
KILL DIC
IF Y>0
KILL XQID(X)
DO SET1
+3 SET XQID=""
FOR XQI=0:0
SET XQID=$ORDER(XQID(XQID))
IF XQID=""
QUIT
SET DIC="^XMB(1,1,""ABPKG"",XQDA,1,"
SET DIC(0)="M"
SET X=XQID
SET DA(1)=XQDA
SET DA(2)=1
KILL XQID(XQID)
DO ^DIC
IF Y>0
SET DA=+Y
SET DIE=DIC
SET DR=".01///@"
DO ^DIE
+4 QUIT
SET1 ;
+1 SET XQD1=+Y
FOR XQJ=4:1
SET X=$PIECE(XQB,";",XQJ)
IF X=""
QUIT
SET DIC="^XMB(1,1,""ABPKG"",XQDA,1,XQD1,1,"
SET DIC(0)="ML"
SET DLAYGO=4.3
SET DIC("P")=4.33211
SET DA(3)=1
SET DA(2)=XQDA
SET DA(1)=XQD1
DO ^DIC
KILL DIC
+2 QUIT
+3 ;
RMVTEST DO CLROPTS
SET DIK="^XMB(1,1,""ABPKG"","
SET DA(1)=1
SET DA=XQDA
DO ^DIK
IF $ORDER(^XMB(1,1,"ABPKG",0))'>0
KILL ^XMB(1,1,"ABOPT")
+1 QUIT
+2 ;
CLROPTS SET $PIECE(XQBLNK," ",30)=" "
+1 KILL ^TMP($JOB,"XQAB"),^("XQOPT")
+2 SET X1=$PIECE(^XMB(1,1,"ABPKG",XQDA,0),U,2)
SET X2=$PIECE(^(0),U,3)
SET X3=$PIECE(^(0),U,4)
SET X3=$SELECT(X3="":$EXTRACT(XQVERS,1,$LENGTH(XQVERS)-1)_($EXTRACT(XQVERS,$LENGTH(XQVERS))-1),1:X3)
+3 SET ^TMP($JOB,"XQAB",1)=" "_XQPKG_" v"_X3_" OPTION USAGE SINCE "_$EXTRACT(X1,4,5)_"-"_$EXTRACT(X1,6,7)_"-"_$EXTRACT(X1,2,3)
SET ^(2)=" "
SET XQC=2
DO GETDATA
IF $DATA(^TMP($JOB,"XQOPT"))
DO OUTPUT
+4 QUIT
GETDATA ;
+1 FOR XQ1=0:0
SET XQ1=$ORDER(^XMB(1,1,"ABPKG",XQDA,1,XQ1))
IF XQ1'>0
QUIT
SET XQID=$PIECE(^(XQ1,0),U)
SET XQID(XQID)=""
DO CHECK
+2 QUIT
+3 ;
CHECK SET XQA=$EXTRACT(XQID,1,$LENGTH(XQID)-1)_$CHAR($ASCII($EXTRACT(XQID,$LENGTH(XQID)))-1)_"z"
+1 FOR XQ2=0:0
SET XQA=$ORDER(^DIC(19,"B",XQA))
IF XQA=""!($EXTRACT(XQA,1,$LENGTH(XQID))'=XQID)
QUIT
IF $EXTRACT(XQA,$LENGTH(XQID)+1)'="Z"
DO CHK2
+2 QUIT
+3 ;
CHK2 FOR XQ3=0:0
SET XQ3=$ORDER(^XMB(1,1,"ABPKG",XQDA,1,XQ1,1,XQ3))
IF XQ3'>0
QUIT
SET XQ4=$PIECE(^(XQ3,0),U)
IF $EXTRACT(XQA,1,$LENGTH(XQ4))=XQ4
QUIT
+1 IF XQ3'>0
FOR XQ4=0:0
SET XQ4=$ORDER(^DIC(19,"B",XQA,XQ4))
IF XQ4'>0
QUIT
SET XQN=$PIECE(^DIC(19,XQ4,0),U,1,4)
SET X=$SELECT($DATA(^XMB(1,1,"ABOPT",XQ4,0)):+$PIECE(^(0),U,2),1:0)
KILL ^XMB(1,1,"ABOPT",XQ4,0)
SET ^TMP($JOB,"XQOPT",XQID,(X+1),XQA,XQ4)=XQ4_U_X_U_XQN
+2 QUIT
+3 ;
OUTPUT SET XQID=""
+1 FOR XQ0=0:0
SET XQID=$ORDER(^TMP($JOB,"XQOPT",XQID))
IF XQID=""
QUIT
DO SPACE
FOR XQ1=0:0
SET XQ1=$ORDER(^TMP($JOB,"XQOPT",XQID,XQ1))
IF XQ1'>0
QUIT
SET XQA=""
FOR XQ2=0:0
SET XQA=$ORDER(^TMP($JOB,"XQOPT",XQID,XQ1,XQA))
IF XQA=""
QUIT
DO OUTA
+2 SET XMY(XQADRS)=""
SET XMY(DUZ)=""
SET XMDUZ=.5
SET XMSUB=XQPKG_" "_XQ3_" ALPHA/BETA TEST OPTION USAGE"
SET XMTEXT="^TMP($J,""XQAB"","
DO ^XMD
KILL ^TMP($JOB,"XQAB"),^("XQOPT"),XMY,XMDUZ,XMSUB,XMTEXT
+3 QUIT
+4 QUIT
+5 ;
SPACE SET XQC=XQC+1
SET ^TMP($JOB,"XQAB",XQC)=" "
+1 QUIT
OUTA ;
+1 FOR XQ3=0:0
SET XQ3=$ORDER(^TMP($JOB,"XQOPT",XQID,XQ1,XQA,XQ3))
IF XQ3'>0
QUIT
SET X=^(XQ3)
SET XQZ=$PIECE(X,U,2)
SET Y=$PIECE(X,U,3,99)
DO MAIL
+2 QUIT
MAIL ;
+1 SET XQC=XQC+1
SET ^TMP($JOB,"XQAB",XQC)=$EXTRACT($EXTRACT($PIECE(Y,U),1,24)_XQBLNK,1,26)_$PIECE(Y,U,4)_" "_$JUSTIFY(+XQZ,6)_" "_$EXTRACT($PIECE(Y,U,2),1,38)
+2 QUIT
+3 ;
PKGNAM ;;TOOLKIT;
ABTEST ;;NO;
ADRESS ;;G.KERNEL DEVELOPERS@DOMAIN.NAME;
SENMSG ;;YES;