DG53296M ;ALB/JAT DG*5.3*296 POST-INSTALL TO MAILMAN MSG;01 JUNE 2000
;;5.3;Registration;**296,1015**;JUNE 1 2000;Build 21
;
;This was copied from DG53285M
;
;This routine will be run as part of the post-install for patch
;DG*5.3*296
;
;A mail message will be sent to the user when the post-install is
; complete.
;
;
MAIL ; Send a mailman msg to user with results
N DIFROM,%
N DATA,DATA1,FILE,FLD,IENX,IY,NODE,TEXT,I,X,XMDUZ,XMSUB,XMTEXT,XMY,Y,STA
K ^TMP("DG53296",$J)
S XMSUB="Purge of Duplicate Means Tests"
S XMDUZ="IVM/HEC PACKAGE",XMY(DUZ)="",XMY(.5)=""
S XMTEXT="^TMP(""DG53296"",$J,"
D NOW^%DTC S Y=% D DD^%DT
S ^TMP("DG53296",$J,1)="Purge of Duplicate Means Tests"
S ^TMP("DG53296",$J,2)=" "
S TEXT="Income year"
S TEXT=$$BLDSTR("# of IVM MT purged",TEXT,20,18)
S ^TMP("DG53296",$J,3)=TEXT
S ^TMP("DG53296",$J,4)=$$REPEAT^XLFSTR("=",$L(TEXT))
S IY=0,NODE=4
F S IY=$O(^XTMP("DG-AMTIY",IY)) Q:'IY D
. S DATA=^XTMP("DG-AMTIY",IY)
. S TEXT=IY+1700
. S DATA1=$J(+$P(DATA,U),6)
. S TEXT=$$BLDSTR(DATA1,TEXT,20,$L(DATA1))
. S NODE=NODE+1
. S ^TMP("DG53296",$J,NODE)=TEXT
F I=1:1:2 S NODE=NODE+1,^TMP("DG53296",$J,NODE)=" "
;
; add error reports to the mail message
I $O(^XTMP("DG-AMTERR",0))'="" D
.S NODE=NODE+1
.S ^TMP("DG53296",$J,NODE)="Some records were not edited due to filing errors:"
.S NODE=NODE+1
.S ^TMP("DG53296",$J,NODE)=" "
.S TEXT="File #"
.S TEXT=$$BLDSTR("Record #",TEXT,12,8)
.S TEXT=$$BLDSTR("Field #",TEXT,22,7)
.S TEXT=$$BLDSTR("Error Message",TEXT,30,13)
.S NODE=NODE+1
.S ^TMP("DG53296",$J,NODE)=TEXT
.S FILE=0
.F S FILE=$O(^XTMP("DG-AMTERR",FILE)) Q:'FILE D
..S TEXT=FILE
..S IENX=0
..F S IENX=$O(^XTMP("DG-AMTERR",FILE,IENX)) Q:'IENX D
...S FLD=0
...F S FLD=$O(^XTMP("DG-AMTERR",FILE,IENX,FLD)) Q:'FLD D
....S DATA=^XTMP("DG-AMTERR",FILE,IENX,FLD)
....S TEXT=$$BLDSTR(IENX,TEXT,12,$L(IENX))
....S TEXT=$$BLDSTR(FLD,TEXT,22,$L(FLD))
....S TEXT=$$BLDSTR(DATA,TEXT,30,$L(DATA))
....S NODE=NODE+1
....S ^TMP("DG53296",$J,NODE)=TEXT
;
MAIL1 D ^XMD
K ^TMP("DG53296",$J),^XTMP("DG-AMTERR"),^XTMP("DG-AMTIY")
Q
;
BLDSTR(NSTR,STR,COL,NSL) ; build a string
; Input:
; NSTR = a string to be added to STR
; STR = an existing string to which NSTR will be added
; COL = column location at which NSTR will be added to STR
; NSL = length of new string
; Output:
; returns STR with NSTR appended at the specified COL
;
Q $E(STR_$J("",COL-1),1,COL-1)_$E(NSTR_$J("",NSL),1,NSL)_$E(STR,COL+NSL,999)
DG53296M ;ALB/JAT DG*5.3*296 POST-INSTALL TO MAILMAN MSG;01 JUNE 2000
+1 ;;5.3;Registration;**296,1015**;JUNE 1 2000;Build 21
+2 ;
+3 ;This was copied from DG53285M
+4 ;
+5 ;This routine will be run as part of the post-install for patch
+6 ;DG*5.3*296
+7 ;
+8 ;A mail message will be sent to the user when the post-install is
+9 ; complete.
+10 ;
+11 ;
MAIL ; Send a mailman msg to user with results
+1 NEW DIFROM,%
+2 NEW DATA,DATA1,FILE,FLD,IENX,IY,NODE,TEXT,I,X,XMDUZ,XMSUB,XMTEXT,XMY,Y,STA
+3 KILL ^TMP("DG53296",$JOB)
+4 SET XMSUB="Purge of Duplicate Means Tests"
+5 SET XMDUZ="IVM/HEC PACKAGE"
SET XMY(DUZ)=""
SET XMY(.5)=""
+6 SET XMTEXT="^TMP(""DG53296"",$J,"
+7 DO NOW^%DTC
SET Y=%
DO DD^%DT
+8 SET ^TMP("DG53296",$JOB,1)="Purge of Duplicate Means Tests"
+9 SET ^TMP("DG53296",$JOB,2)=" "
+10 SET TEXT="Income year"
+11 SET TEXT=$$BLDSTR("# of IVM MT purged",TEXT,20,18)
+12 SET ^TMP("DG53296",$JOB,3)=TEXT
+13 SET ^TMP("DG53296",$JOB,4)=$$REPEAT^XLFSTR("=",$LENGTH(TEXT))
+14 SET IY=0
SET NODE=4
+15 FOR
SET IY=$ORDER(^XTMP("DG-AMTIY",IY))
IF 'IY
QUIT
Begin DoDot:1
+16 SET DATA=^XTMP("DG-AMTIY",IY)
+17 SET TEXT=IY+1700
+18 SET DATA1=$JUSTIFY(+$PIECE(DATA,U),6)
+19 SET TEXT=$$BLDSTR(DATA1,TEXT,20,$LENGTH(DATA1))
+20 SET NODE=NODE+1
+21 SET ^TMP("DG53296",$JOB,NODE)=TEXT
End DoDot:1
+22 FOR I=1:1:2
SET NODE=NODE+1
SET ^TMP("DG53296",$JOB,NODE)=" "
+23 ;
+24 ; add error reports to the mail message
+25 IF $ORDER(^XTMP("DG-AMTERR",0))'=""
Begin DoDot:1
+26 SET NODE=NODE+1
+27 SET ^TMP("DG53296",$JOB,NODE)="Some records were not edited due to filing errors:"
+28 SET NODE=NODE+1
+29 SET ^TMP("DG53296",$JOB,NODE)=" "
+30 SET TEXT="File #"
+31 SET TEXT=$$BLDSTR("Record #",TEXT,12,8)
+32 SET TEXT=$$BLDSTR("Field #",TEXT,22,7)
+33 SET TEXT=$$BLDSTR("Error Message",TEXT,30,13)
+34 SET NODE=NODE+1
+35 SET ^TMP("DG53296",$JOB,NODE)=TEXT
+36 SET FILE=0
+37 FOR
SET FILE=$ORDER(^XTMP("DG-AMTERR",FILE))
IF 'FILE
QUIT
Begin DoDot:2
+38 SET TEXT=FILE
+39 SET IENX=0
+40 FOR
SET IENX=$ORDER(^XTMP("DG-AMTERR",FILE,IENX))
IF 'IENX
QUIT
Begin DoDot:3
+41 SET FLD=0
+42 FOR
SET FLD=$ORDER(^XTMP("DG-AMTERR",FILE,IENX,FLD))
IF 'FLD
QUIT
Begin DoDot:4
+43 SET DATA=^XTMP("DG-AMTERR",FILE,IENX,FLD)
+44 SET TEXT=$$BLDSTR(IENX,TEXT,12,$LENGTH(IENX))
+45 SET TEXT=$$BLDSTR(FLD,TEXT,22,$LENGTH(FLD))
+46 SET TEXT=$$BLDSTR(DATA,TEXT,30,$LENGTH(DATA))
+47 SET NODE=NODE+1
+48 SET ^TMP("DG53296",$JOB,NODE)=TEXT
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+49 ;
MAIL1 DO ^XMD
+1 KILL ^TMP("DG53296",$JOB),^XTMP("DG-AMTERR"),^XTMP("DG-AMTIY")
+2 QUIT
+3 ;
BLDSTR(NSTR,STR,COL,NSL) ; build a string
+1 ; Input:
+2 ; NSTR = a string to be added to STR
+3 ; STR = an existing string to which NSTR will be added
+4 ; COL = column location at which NSTR will be added to STR
+5 ; NSL = length of new string
+6 ; Output:
+7 ; returns STR with NSTR appended at the specified COL
+8 ;
+9 QUIT $EXTRACT(STR_$JUSTIFY("",COL-1),1,COL-1)_$EXTRACT(NSTR_$JUSTIFY("",NSL),1,NSL)_$EXTRACT(STR,COL+NSL,999)