XMUT5R1 ;(WASH ISC)/CAP-Mail Statistics Report ;05/28/2002  07:19
 ;;8.0;MailMan;;Jun 28, 2002
 ; Entry points used by MailMan options (not covered by DBIA):
 ; STATS   XMMGR-NEWMESS/LOGON-STATS
 ; 0       XMMGR-BKFILER-LONGTERM-STATS (not part of 8.0)
STATS ;
0 ;
 N XMEND,XMSTART,XMABORT
 S XMABORT=0
 D INIT(.XMSTART,.XMEND,.XMABORT) Q:XMABORT
 D REPORT(XMSTART,XMEND)
 Q
INIT(XMSTART,XMEND,XMABORT) ;
 N DIR,X,Y,DIRUT
 S XMEND=$$FMADD^XLFDT($E(DT,1,5)_"01",-1)  ; last day of last month
 S XMSTART=$E(XMEND,1,5)_"01"  ; first day of last month
 Q:$D(ZTQUEUED)
 S DIR("A")="START Date"
 S DIR("B")=$$FMTE^XLFDT(XMSTART,"2D")   ; MM/DD/YY
 S DIR(0)="D^:"_$$FMADD^XLFDT(DT,-1)_":EX"
 D ^DIR I $D(DIRUT) S XMABORT=1 Q
 S XMSTART=Y
 K X,Y,DIR,DIRUT
 S XMEND=$$FMADD^XLFDT(XMSTART,-1)
 S XMEND=$$SCH^XLFDT("1M",XMEND)       ; 1 month from XMSTART
 S DIR("A")="END Date"
 S DIR("B")=$$FMTE^XLFDT($$MIN^XLFMTH(XMEND,DT),"2D")   ; MM/DD/YY
 S DIR(0)="D^"_$$FMADD^XLFDT(XMSTART,+1)_":DT:EX"
 D ^DIR I $D(DIRUT) S XMABORT=1 Q
 S XMEND=Y
 Q
REPORT(XMA,XMB) ;
ZTSK ;Entry for Tasked report
 ;XMA=Start Date FM format
 ;XMAH=Start Date $H format
 ;XMB=End Date FM format
 ;XMBH=End Date $H format
 N XMC,XMD,XMV,BY,DIC,FLDS,FR,TO,L,X
 S X=XMB
 I '$D(ZTQUEUED) W !!,"Calling FileMan template ..."
 S XMD=$$FMTE^XLFDT(DT,"1D")  ; mmm dd, yyyy
 S XMC=$P(^XMB("NETNAME"),".")_" MailMan Activity Report"
 S XMV=^%ZOSF("PROD")
 S BY="[XMMGR-BKFILER-DAY@23:30]",FLDS="[XMMGR-BKFILER-LONGTERM-STATS]",FR=XMA,TO=XMB_".2359",DIC="^XMBX(4.2998,",L="Report on Statistics"
 S:$D(ZTQUEUED) IOP=ZTIO
 D EN1^DIP
 K DIS,XMA,XMB,XMAH,XMBH,X,Y,Z,%ZIS,ZTRTN,ZTSAVE,ZTDTH
 I '$D(ZTQUEUED) K ZTSK
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXMUT5R1   1717     printed  Sep 23, 2025@19:49:41                                                                                                                                                                                                     Page 2
XMUT5R1   ;(WASH ISC)/CAP-Mail Statistics Report ;05/28/2002  07:19
 +1       ;;8.0;MailMan;;Jun 28, 2002
 +2       ; Entry points used by MailMan options (not covered by DBIA):
 +3       ; STATS   XMMGR-NEWMESS/LOGON-STATS
 +4       ; 0       XMMGR-BKFILER-LONGTERM-STATS (not part of 8.0)
STATS     ;
0         ;
 +1        NEW XMEND,XMSTART,XMABORT
 +2        SET XMABORT=0
 +3        DO INIT(.XMSTART,.XMEND,.XMABORT)
           if XMABORT
               QUIT 
 +4        DO REPORT(XMSTART,XMEND)
 +5        QUIT 
INIT(XMSTART,XMEND,XMABORT) ;
 +1        NEW DIR,X,Y,DIRUT
 +2       ; last day of last month
           SET XMEND=$$FMADD^XLFDT($EXTRACT(DT,1,5)_"01",-1)
 +3       ; first day of last month
           SET XMSTART=$EXTRACT(XMEND,1,5)_"01"
 +4        if $DATA(ZTQUEUED)
               QUIT 
 +5        SET DIR("A")="START Date"
 +6       ; MM/DD/YY
           SET DIR("B")=$$FMTE^XLFDT(XMSTART,"2D")
 +7        SET DIR(0)="D^:"_$$FMADD^XLFDT(DT,-1)_":EX"
 +8        DO ^DIR
           IF $DATA(DIRUT)
               SET XMABORT=1
               QUIT 
 +9        SET XMSTART=Y
 +10       KILL X,Y,DIR,DIRUT
 +11       SET XMEND=$$FMADD^XLFDT(XMSTART,-1)
 +12      ; 1 month from XMSTART
           SET XMEND=$$SCH^XLFDT("1M",XMEND)
 +13       SET DIR("A")="END Date"
 +14      ; MM/DD/YY
           SET DIR("B")=$$FMTE^XLFDT($$MIN^XLFMTH(XMEND,DT),"2D")
 +15       SET DIR(0)="D^"_$$FMADD^XLFDT(XMSTART,+1)_":DT:EX"
 +16       DO ^DIR
           IF $DATA(DIRUT)
               SET XMABORT=1
               QUIT 
 +17       SET XMEND=Y
 +18       QUIT 
REPORT(XMA,XMB) ;
ZTSK      ;Entry for Tasked report
 +1       ;XMA=Start Date FM format
 +2       ;XMAH=Start Date $H format
 +3       ;XMB=End Date FM format
 +4       ;XMBH=End Date $H format
 +5        NEW XMC,XMD,XMV,BY,DIC,FLDS,FR,TO,L,X
 +6        SET X=XMB
 +7        IF '$DATA(ZTQUEUED)
               WRITE !!,"Calling FileMan template ..."
 +8       ; mmm dd, yyyy
           SET XMD=$$FMTE^XLFDT(DT,"1D")
 +9        SET XMC=$PIECE(^XMB("NETNAME"),".")_" MailMan Activity Report"
 +10       SET XMV=^%ZOSF("PROD")
 +11       SET BY="[XMMGR-BKFILER-DAY@23:30]"
           SET FLDS="[XMMGR-BKFILER-LONGTERM-STATS]"
           SET FR=XMA
           SET TO=XMB_".2359"
           SET DIC="^XMBX(4.2998,"
           SET L="Report on Statistics"
 +12       if $DATA(ZTQUEUED)
               SET IOP=ZTIO
 +13       DO EN1^DIP
 +14       KILL DIS,XMA,XMB,XMAH,XMBH,X,Y,Z,%ZIS,ZTRTN,ZTSAVE,ZTDTH
 +15       IF '$DATA(ZTQUEUED)
               KILL ZTSK
 +16       QUIT