Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XMCQH

XMCQH.m

Go to the documentation of this file.
  1. XMCQH ;ISC-SF/GMB-Transmit Queue History ;01/08/2003 13:52
  1. ;;8.0;MailMan;**8,14**;Jun 28, 2002
  1. ; Was (WASH ISC)/CAP/AML/RJ
  1. ;
  1. ; Entry points used by MailMan options (not covered by DBIA):
  1. ; ENTER XMQHIST (was ^XMS4)
  1. ENTER ;
  1. N XMPARM,XMABORT
  1. S XMABORT=0
  1. D INIT(.XMPARM,.XMABORT) Q:XMABORT
  1. S ZTSAVE("XMPARM(")=""
  1. D EN^XUTMDEVQ("ENT^XMCQH",$$EZBLD^DIALOG(42100),.ZTSAVE) ; MailMan: Transmission Queue History Report
  1. Q
  1. INIT(XMPARM,XMABORT) ; Get period to report on. Default is current month.
  1. S (XMPARM("START"),XMPARM("END"))=$E(DT,1,5)
  1. Q:$D(ZTQUEUED)
  1. D START(.XMPARM,.XMABORT) Q:XMABORT
  1. D END(.XMPARM,.XMABORT)
  1. Q
  1. START(XMPARM,XMABORT) ; Start of report period
  1. N DIR,Y,X
  1. S DIR(0)="DO^:DT:E"
  1. S DIR("A")=$$EZBLD^DIALOG(42107) ; Start of report period
  1. D BLD^DIALOG(42107.1,"","","DIR(""?"")")
  1. ;Enter a month and year or just a year. Any day will be ignored.
  1. ;This is the start of the period you want reported. The report will
  1. ;start on the first day of the period you enter.
  1. S DIR("B")=$$FMTE^XLFDT(XMPARM("START")_"00")
  1. D ^DIR I $D(DUOUT)!$D(DTOUT) S XMABORT=1 Q
  1. S XMPARM("START")=$E(Y,1,5)
  1. Q
  1. END(XMPARM,XMABORT) ; End of report period
  1. S XMPARM("END")=XMPARM("START")
  1. Q:$E(XMPARM("START"),1,5)=$E(DT,1,5) ; This month
  1. Q:XMPARM("START")=($E(DT,1,3)_"00") ; This year
  1. N DIR,Y,X,XMDT
  1. S XMDT=XMPARM("START")
  1. S:$E(XMDT,4,5)="00" XMDT=$E(XMDT,1,3)_"01"
  1. S DIR(0)="DO^"_XMDT_"01:DT:E"
  1. S DIR("A")=$$EZBLD^DIALOG(42108) ; End of report period
  1. D BLD^DIALOG(42108.1,"","","DIR(""?"")")
  1. ;Enter a month and year or just a year. Press enter to accept the default.
  1. ;This is the end of the period you want reported. The report will go
  1. ;through the last day of the period you enter.
  1. I $E(XMPARM("END"),4,5)="00" S XMPARM("END")=$E(XMPARM("END"),1,3)_"1200"
  1. E S XMPARM("END")=$$SCH^XLFDT("1M(L)",XMPARM("END")_"01")
  1. S DIR("B")=$$FMTE^XLFDT(XMPARM("END"))
  1. D ^DIR I $D(DUOUT)!$D(DTOUT) S XMABORT=1 Q
  1. S XMPARM("END")=$E(Y,1,5)
  1. Q
  1. ENT ;
  1. N XMNAME,XMRPT,XMIEN,XMREC,XMABORT,XMQD,XMCNT,XMTITLE,XMMON,XMSENT,XMRCVD
  1. ;Transmission Queue History
  1. ;Domain Queued Sent Rcvd Domain Queued Sent Rcvd
  1. I $E(XMPARM("END"),4,5)'="00",$E(XMPARM("START"),4,5)="00" D
  1. . I $E(XMPARM("END"),4,5)=12 S XMPARM("END")=XMPARM("START") Q
  1. . S $E(XMPARM("START"),4,5)="01"
  1. I $E(XMPARM("END"),4,5)="00",$E(XMPARM("START"),4,5)'="00" D
  1. . I $E(XMPARM("END"),1,3)=$E(DT,1,3) S XMPARM("END")=$E(DT,1,5) Q
  1. . S $E(XMPARM("END"),4,5)=12
  1. I XMPARM("START")=XMPARM("END") D
  1. . S XMTITLE=$$EZBLD^DIALOG(42101,$$FMTE^XLFDT(XMPARM("START")_"00")) ;Transmission Queue History, |1|
  1. E D
  1. . N XMP S XMP(1)=$$FMTE^XLFDT(XMPARM("START")_"00"),XMP(2)=$$FMTE^XLFDT(XMPARM("END")_"00")
  1. . S XMTITLE=$$EZBLD^DIALOG(42101.1,.XMP) ;Transmission Queue History, |1| - |2|
  1. D INIT^XMCQA(.XMRPT,XMTITLE,42102)
  1. I $E(XMPARM("END"),4,5)="00" S XMPARM("END")=$E(XMPARM("END"),1,3)_"12"
  1. S XMNAME="",(XMCNT,XMABORT,XMCNT("SENT"),XMCNT("RCVD"),XMCNT("QD"))=0
  1. F S XMNAME=$O(^DIC(4.2,"B",XMNAME)) Q:XMNAME="" D Q:XMABORT
  1. . S XMIEN=""
  1. . F S XMIEN=$O(^DIC(4.2,"B",XMNAME,XMIEN)) Q:'XMIEN D Q:XMABORT
  1. . . S (XMSENT,XMRCVD)=0
  1. . . S XMMON=XMPARM("START")-.01
  1. . . F S XMMON=$O(^XMBS(4.2999,XMIEN,100,XMMON)) Q:XMMON>XMPARM("END")!'XMMON D
  1. . . . S XMREC=$G(^XMBS(4.2999,XMIEN,100,XMMON,0))
  1. . . . S XMSENT=XMSENT+$P(XMREC,U,2),XMRCVD=XMRCVD+$P(XMREC,U,3)
  1. . . S XMQD=$$BMSGCT^XMXUTIL(.5,XMIEN+1000)
  1. . . I 'XMQD,'XMSENT,'XMRCVD Q
  1. . . S XMCNT("SENT")=XMCNT("SENT")+XMSENT
  1. . . S XMCNT("RCVD")=XMCNT("RCVD")+XMRCVD
  1. . . S XMCNT("QD")=XMCNT("QD")+XMQD
  1. . . S XMCNT=XMCNT+1
  1. . . I XMCNT#2 D Q:XMABORT
  1. . . . I $Y+3>IOSL D Q:XMABORT
  1. . . . . D PAGE^XMCQA(.XMABORT) Q:XMABORT
  1. . . . . D HDR^XMCQA(.XMRPT)
  1. . . . W !
  1. . . E W " "
  1. . . W $$MELD^XMXUTIL1(XMNAME,XMQD,22),$J(XMSENT,8),$J(XMRCVD,8)
  1. Q:XMABORT
  1. I $Y+7>IOSL D Q:XMABORT
  1. . D PAGE^XMCQA(.XMABORT)
  1. . D HDR^XMCQA(.XMRPT)
  1. W !!,$$MELD^XMXUTIL1($$EZBLD^DIALOG(42103),XMCNT,27) ; Total Domains:
  1. W !,$$MELD^XMXUTIL1($$EZBLD^DIALOG(42104),XMCNT("QD"),27) ; Total Queued:
  1. W !,$$MELD^XMXUTIL1($$EZBLD^DIALOG(42105),XMCNT("SENT"),27) ; Total Sent:
  1. W !,$$MELD^XMXUTIL1($$EZBLD^DIALOG(42106),XMCNT("RCVD"),27) ; Total Received:
  1. I $D(ZTQUEUED) S ZTREQ="@"
  1. Q