KMPDTP3 ;OAK/RAK/JML - CP Timing Hourly Time-to-Load ;9/1/2015
;;3.0;Capacity Management Tools;**3**;Jan 15, 2013;Build 42
;
EN ;-- entry point
N KMPDATE,KMPDFGBG,KMPDSTAR,KMPDSTTL,KMPDSUB,KMPDTTL,POP,X,Y,ZTDESC,ZTRTN,ZTRSAVE,%ZIS
N KMPDLBG,KMPDLFG,KMPDDTSS
S KMPDTTL=" Hourly Coversheet Time-to-Load (TTL) Report "
D HDR^KMPDUTL4(KMPDTTL)
W !
W !?7,"This report displays the hourly average time-to-load value"
W !?7,"for the coversheet at this site over 24 hours."
W !?7,"Foreground, background and combined values are reported."
W !
;
; if no data
I '$O(^KMPD(8973.2,0)) D Q
.W !!?7,"*** There is currently no data in file #8973.2 (CP TIMING) ***"
;
; select date range - first determine which subscript to use in API due to addition of foreground processing
S KMPDLFG=$O(^KMPD(8973.2,"ASSDTTM","ORWCV-FT","A"),-1)
S KMPDLBG=$O(^KMPD(8973.2,"ASSDTTM","ORWCV","A"),-1)
S KMPDDTSS=$S(KMPDLFG=KMPDLBG:"ORWCV-FT",KMPDLFG>KMPDLBG:"ORWCV-FT",KMPDLFG<KMPDLBG:"ORWCV",1:"UNKNOWN")
D DATERNG^KMPDTU10(KMPDDTSS,1,.KMPDATE)
Q:$G(KMPDATE(0))=""
; select output device.
S %ZIS="Q",%ZIS("A")="Device: ",%ZIS("B")="HOME"
W ! D ^%ZIS I POP W !,"No action taken." Q
; if queued.
I $D(IO("Q")) K IO("Q") D Q
.S ZTDESC=KMPDTTL
.S ZTRTN="EN1^KMPDTP3"
.S ZTSAVE("KMPDATE(")="",ZTSAVE("KMPDTTL")=""
.D ^%ZTLOAD W:$G(ZTSK) !,"Task #",ZTSK
.D EXIT
;
; if output to terminal display message.
W:$E(IOST,1,2)="C-" !,"Compiling timing stats..."
D EN1
;
Q
;
EN1 ;-- entry point from taskman
Q:'$D(KMPDATE)
K ^TMP($J)
F KMPDSUB="ORWCV","ORWCV-FT" D DATA(KMPDSUB)
D PRINT,EXIT
K ^TMP($J)
Q
;
DATA(KMPDSUB) ;-- compile data
Q:'$D(KMPDATE)
N DATA,DATE,DELTA,DOT,END,HR,I,IEN,PTNP,QUEUED,TOTAL
S DATE=$P(KMPDATE(0),U)-.1,END=$P(KMPDATE(0),U,2)
Q:'DATE!('END)
S DOT=1,QUEUED=$D(ZTQUEUED)
F S DATE=$O(^KMPD(8973.2,"ASVDTSS",KMPDSUB,DATE)) Q:'DATE!(DATE>END) D
.S (IEN,TOTAL)=0
.; array with hours
.F I=0:1:23 S ^TMP($J,KMPDSUB,DATE,I)=""
.F S IEN=$O(^KMPD(8973.2,"ASVDTSS",KMPDSUB,DATE,IEN)) Q:'IEN D
..Q:'$D(^KMPD(8973.2,IEN,0)) S DATA=^(0) Q:DATA=""
..S DOT=DOT+1 W:'QUEUED&('(DOT#1000)) "."
..; get delta and hour
..S DELTA=$P(DATA,U,4),HR=+$E($P($P(DATA,U,3),".",2),1,2)
..S HR=$S(HR="":0,HR=24:0,1:HR)
..; if delta
..I $P(DATA,U,4)'="" D
...; minimum delta
...I $P(^TMP($J,KMPDSUB,DATE,HR),U,2)=""!($P(DATA,U,4)<$P(^TMP($J,KMPDSUB,DATE,HR),U,2)) D
....S $P(^TMP($J,KMPDSUB,DATE,HR),U,2)=$P(DATA,U,4)
...; maximum delta
...I $P(DATA,U,4)>$P(^TMP($J,KMPDSUB,DATE,HR),U,3) S $P(^TMP($J,KMPDSUB,DATE,HR),U,3)=$P(DATA,U,4)
...; total delta
...S $P(^TMP($J,KMPDSUB,DATE,HR),U,4)=$P(^TMP($J,KMPDSUB,DATE,HR),U,4)+$P(DATA,U,4)
...; count
...S $P(^TMP($J,KMPDSUB,DATE,HR),U,5)=$P(^TMP($J,KMPDSUB,DATE,HR),U,5)+1
..; if no delta
..E S $P(^TMP($J,KMPDSUB,DATE,HR),U,6)=$P(^TMP($J,KMPDSUB,DATE,HR),U,6)+1
.;
.; back to DATE level
.; average
.F I=0:1:23 I $P(^TMP($J,KMPDSUB,DATE,I),U,5) D
..S $P(^TMP($J,KMPDSUB,DATE,I),U)=$P(^TMP($J,KMPDSUB,DATE,I),U,4)/$P(^TMP($J,KMPDSUB,DATE,I),U,5)
;
Q
;
PRINT ;-- print data
U IO
S KMPDFGBG=0
I $D(^TMP($J,"ORWCV")) S KMPDFGBG=1
I $D(^TMP($J,"ORWCV-FT")) S KMPDFGBG=KMPDFGBG+2
I KMPDFGBG=1 D PRINTONE("ORWCV","Background")
I KMPDFGBG=2 D PRINTONE("ORWCV-FT","Foreground")
I KMPDFGBG=3 D PRNTBOTH
Q
;
PRINTONE(KMPDSUB,KMPDSTTL) ;
U IO
D HDR(KMPDSTTL)
Q:'$D(^TMP($J,KMPDSUB))
N CONT,DATE,HR,I,TOTAL
S DATE="",CONT=1,KMPDSTAR=0
F S DATE=$O(^TMP($J,KMPDSUB,DATE)) Q:'DATE S HR="" D Q:'CONT
.S TOTAL=""
.W !,$$FMTE^XLFDT(DATE,2)
.F S HR=$O(^TMP($J,KMPDSUB,DATE,HR)) Q:HR="" D Q:'CONT
..; page feed
..I $Y>(IOSL-3) D CONTINUE^KMPDUTL4("",1,.CONT) Q:'CONT D HDR(KMPDSTTL) W !
..W ?12," ",$S($L(HR)=1:"0",1:""),HR
..S DATA=^TMP($J,KMPDSUB,DATE,HR)
..W ?20,$J($FN($P(DATA,U),",",0),10)
..W ?34,$J($FN($P(DATA,U,2),",",0),10)
..W ?48,$J($FN($P(DATA,U,3),",",0),10)
..W ?62,$J($FN($P(DATA,U,5),",",0),10)
..I $P(DATA,U,5)["*" W "*" S KMPDSTAR=1
..W !
..S $P(TOTAL,U)=$P(TOTAL,U)+$P(DATA,U,5)
..S $P(TOTAL,U,2)=$P(TOTAL,U,2)+$P(DATA,U,6)
.;
.; back to DATE level
.; totals
.W ?62,"----------",!?62,$J($FN(TOTAL,",",0),10),!
.W !?12,"Incomplete: ",$J($FN($P(TOTAL,U,2),",",0),$L($P(TOTAL,U,2))+2),!
.; if another date
.I $O(^TMP($J,KMPDSUB,DATE)) D CONTINUE^KMPDUTL4("",1,.CONT) Q:'CONT D HDR(KMPDSTTL) W !
;
I CONT D
.; legend
.W !!?2,"CV = Coversheet" I KMPDSTAR=1 W ?35,"* = BG/FG Load Counts not equal."
.W !?2,"TTL = Time-to-Load" I KMPDSTAR=1 W ?35,"Listing FOREGROUND Load Count"
.; pause if output to terminal
.D CONTINUE^KMPDUTL4("Press RETURN to continue",1)
;
Q
;
PRNTBOTH ;
; AVG ^ MIN ^ MAX ^ TOTDELTA ^ CNT
N DATE,TOTDATA,HR,BGDATA,BGMAX,BGMIN,BGTOT,FGDATA,FGMAX,FGMIN,FGTOT
S DATE=""
F S DATE=$O(^TMP($J,"ORWCV-FT",DATE)) Q:DATE="" D
.S HR=""
.F S HR=$O(^TMP($J,"ORWCV-FT",DATE,HR)) Q:HR="" D
..S TOTDATA=""
..S FGDATA=$G(^TMP($J,"ORWCV-FT",DATE,HR))
..S BGDATA=$G(^TMP($J,"ORWCV",DATE,HR))
..S $P(TOTDATA,U)=$P(FGDATA,U)+$P(BGDATA,U)
..S FGMIN=$P(FGDATA,U,2),BGMIN=$P(BGDATA,U,2)
..S $P(TOTDATA,U,2)=$S(FGMIN<BGMIN:FGMIN,1:BGMIN)
..S FGMAX=$P(FGDATA,U,3),BGMAX=$P(BGDATA,U,3)
..S $P(TOTDATA,U,3)=$S(BGMAX>FGMAX:BGMAX,1:FGMAX)
..S $P(TOTDATA,U,4)=$P(FGDATA,U,5)+$P(BGDATA,U,4)
..S FGTOT=$P(FGDATA,U,5),BGTOT=$P(BGDATA,U,5)
..S $P(TOTDATA,U,5)=$S(FGTOT=BGTOT:FGTOT,1:FGTOT_"*")
..S $P(TOTDATA,U,6)=$P(FGDATA,U,6)+$P(BGDATA,U,6)
..S ^TMP($J,"ORWCV-BOTH",DATE,HR)=TOTDATA
D PRINTONE("ORWCV","BACKGROUND")
D PRINTONE("ORWCV-FT","FOREGROUND")
D PRINTONE("ORWCV-BOTH","Combined FOREGROUND and BACKGROUND")
Q
;
HDR(KMPDSTTL) ;-- print header
W @IOF
S X=$G(KMPDTTL)
W !?(80-$L(X)\2),X
S X=KMPDSTTL_" Coversheet Loads"
W !?(80-$L(X)\2),X
S X=$G(KMPDATE(0)),X=$P(X,U,3)_" - "_$P(X,U,4)
W !?(80-$L(X)\2),X,?61,"Printed: ",$$FMTE^XLFDT(DT,2)
W !
W !?20,"|---------------Seconds---------------|"
W !,"Date",?12,"Hour",?20,"TTL Average",?34,"TTL Minimum",?48,"TTL Maximum",?62,"# of CV Loads"
W !,$$REPEAT^XLFSTR("-",IOM)
;
Q
;
EXIT ;-- cleanup on exit
S:$D(ZTQUEUED) ZTREQ="@"
D ^%ZISC
K KMPDATE,KMPDTTL
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPDTP3 6272 printed Oct 16, 2024@17:41:39 Page 2
KMPDTP3 ;OAK/RAK/JML - CP Timing Hourly Time-to-Load ;9/1/2015
+1 ;;3.0;Capacity Management Tools;**3**;Jan 15, 2013;Build 42
+2 ;
EN ;-- entry point
+1 NEW KMPDATE,KMPDFGBG,KMPDSTAR,KMPDSTTL,KMPDSUB,KMPDTTL,POP,X,Y,ZTDESC,ZTRTN,ZTRSAVE,%ZIS
+2 NEW KMPDLBG,KMPDLFG,KMPDDTSS
+3 SET KMPDTTL=" Hourly Coversheet Time-to-Load (TTL) Report "
+4 DO HDR^KMPDUTL4(KMPDTTL)
+5 WRITE !
+6 WRITE !?7,"This report displays the hourly average time-to-load value"
+7 WRITE !?7,"for the coversheet at this site over 24 hours."
+8 WRITE !?7,"Foreground, background and combined values are reported."
+9 WRITE !
+10 ;
+11 ; if no data
+12 IF '$ORDER(^KMPD(8973.2,0))
Begin DoDot:1
+13 WRITE !!?7,"*** There is currently no data in file #8973.2 (CP TIMING) ***"
End DoDot:1
QUIT
+14 ;
+15 ; select date range - first determine which subscript to use in API due to addition of foreground processing
+16 SET KMPDLFG=$ORDER(^KMPD(8973.2,"ASSDTTM","ORWCV-FT","A"),-1)
+17 SET KMPDLBG=$ORDER(^KMPD(8973.2,"ASSDTTM","ORWCV","A"),-1)
+18 SET KMPDDTSS=$SELECT(KMPDLFG=KMPDLBG:"ORWCV-FT",KMPDLFG>KMPDLBG:"ORWCV-FT",KMPDLFG<KMPDLBG:"ORWCV",1:"UNKNOWN")
+19 DO DATERNG^KMPDTU10(KMPDDTSS,1,.KMPDATE)
+20 if $GET(KMPDATE(0))=""
QUIT
+21 ; select output device.
+22 SET %ZIS="Q"
SET %ZIS("A")="Device: "
SET %ZIS("B")="HOME"
+23 WRITE !
DO ^%ZIS
IF POP
WRITE !,"No action taken."
QUIT
+24 ; if queued.
+25 IF $DATA(IO("Q"))
KILL IO("Q")
Begin DoDot:1
+26 SET ZTDESC=KMPDTTL
+27 SET ZTRTN="EN1^KMPDTP3"
+28 SET ZTSAVE("KMPDATE(")=""
SET ZTSAVE("KMPDTTL")=""
+29 DO ^%ZTLOAD
if $GET(ZTSK)
WRITE !,"Task #",ZTSK
+30 DO EXIT
End DoDot:1
QUIT
+31 ;
+32 ; if output to terminal display message.
+33 if $EXTRACT(IOST,1,2)="C-"
WRITE !,"Compiling timing stats..."
+34 DO EN1
+35 ;
+36 QUIT
+37 ;
EN1 ;-- entry point from taskman
+1 if '$DATA(KMPDATE)
QUIT
+2 KILL ^TMP($JOB)
+3 FOR KMPDSUB="ORWCV","ORWCV-FT"
DO DATA(KMPDSUB)
+4 DO PRINT
DO EXIT
+5 KILL ^TMP($JOB)
+6 QUIT
+7 ;
DATA(KMPDSUB) ;-- compile data
+1 if '$DATA(KMPDATE)
QUIT
+2 NEW DATA,DATE,DELTA,DOT,END,HR,I,IEN,PTNP,QUEUED,TOTAL
+3 SET DATE=$PIECE(KMPDATE(0),U)-.1
SET END=$PIECE(KMPDATE(0),U,2)
+4 if 'DATE!('END)
QUIT
+5 SET DOT=1
SET QUEUED=$DATA(ZTQUEUED)
+6 FOR
SET DATE=$ORDER(^KMPD(8973.2,"ASVDTSS",KMPDSUB,DATE))
if 'DATE!(DATE>END)
QUIT
Begin DoDot:1
+7 SET (IEN,TOTAL)=0
+8 ; array with hours
+9 FOR I=0:1:23
SET ^TMP($JOB,KMPDSUB,DATE,I)=""
+10 FOR
SET IEN=$ORDER(^KMPD(8973.2,"ASVDTSS",KMPDSUB,DATE,IEN))
if 'IEN
QUIT
Begin DoDot:2
+11 if '$DATA(^KMPD(8973.2,IEN,0))
QUIT
SET DATA=^(0)
if DATA=""
QUIT
+12 SET DOT=DOT+1
if 'QUEUED&('(DOT#1000))
WRITE "."
+13 ; get delta and hour
+14 SET DELTA=$PIECE(DATA,U,4)
SET HR=+$EXTRACT($PIECE($PIECE(DATA,U,3),".",2),1,2)
+15 SET HR=$SELECT(HR="":0,HR=24:0,1:HR)
+16 ; if delta
+17 IF $PIECE(DATA,U,4)'=""
Begin DoDot:3
+18 ; minimum delta
+19 IF $PIECE(^TMP($JOB,KMPDSUB,DATE,HR),U,2)=""!($PIECE(DATA,U,4)<$PIECE(^TMP($JOB,KMPDSUB,DATE,HR),U,2))
Begin DoDot:4
+20 SET $PIECE(^TMP($JOB,KMPDSUB,DATE,HR),U,2)=$PIECE(DATA,U,4)
End DoDot:4
+21 ; maximum delta
+22 IF $PIECE(DATA,U,4)>$PIECE(^TMP($JOB,KMPDSUB,DATE,HR),U,3)
SET $PIECE(^TMP($JOB,KMPDSUB,DATE,HR),U,3)=$PIECE(DATA,U,4)
+23 ; total delta
+24 SET $PIECE(^TMP($JOB,KMPDSUB,DATE,HR),U,4)=$PIECE(^TMP($JOB,KMPDSUB,DATE,HR),U,4)+$PIECE(DATA,U,4)
+25 ; count
+26 SET $PIECE(^TMP($JOB,KMPDSUB,DATE,HR),U,5)=$PIECE(^TMP($JOB,KMPDSUB,DATE,HR),U,5)+1
End DoDot:3
+27 ; if no delta
+28 IF '$TEST
SET $PIECE(^TMP($JOB,KMPDSUB,DATE,HR),U,6)=$PIECE(^TMP($JOB,KMPDSUB,DATE,HR),U,6)+1
End DoDot:2
+29 ;
+30 ; back to DATE level
+31 ; average
+32 FOR I=0:1:23
IF $PIECE(^TMP($JOB,KMPDSUB,DATE,I),U,5)
Begin DoDot:2
+33 SET $PIECE(^TMP($JOB,KMPDSUB,DATE,I),U)=$PIECE(^TMP($JOB,KMPDSUB,DATE,I),U,4)/$PIECE(^TMP($JOB,KMPDSUB,DATE,I),U,5)
End DoDot:2
End DoDot:1
+34 ;
+35 QUIT
+36 ;
PRINT ;-- print data
+1 USE IO
+2 SET KMPDFGBG=0
+3 IF $DATA(^TMP($JOB,"ORWCV"))
SET KMPDFGBG=1
+4 IF $DATA(^TMP($JOB,"ORWCV-FT"))
SET KMPDFGBG=KMPDFGBG+2
+5 IF KMPDFGBG=1
DO PRINTONE("ORWCV","Background")
+6 IF KMPDFGBG=2
DO PRINTONE("ORWCV-FT","Foreground")
+7 IF KMPDFGBG=3
DO PRNTBOTH
+8 QUIT
+9 ;
PRINTONE(KMPDSUB,KMPDSTTL) ;
+1 USE IO
+2 DO HDR(KMPDSTTL)
+3 if '$DATA(^TMP($JOB,KMPDSUB))
QUIT
+4 NEW CONT,DATE,HR,I,TOTAL
+5 SET DATE=""
SET CONT=1
SET KMPDSTAR=0
+6 FOR
SET DATE=$ORDER(^TMP($JOB,KMPDSUB,DATE))
if 'DATE
QUIT
SET HR=""
Begin DoDot:1
+7 SET TOTAL=""
+8 WRITE !,$$FMTE^XLFDT(DATE,2)
+9 FOR
SET HR=$ORDER(^TMP($JOB,KMPDSUB,DATE,HR))
if HR=""
QUIT
Begin DoDot:2
+10 ; page feed
+11 IF $Y>(IOSL-3)
DO CONTINUE^KMPDUTL4("",1,.CONT)
if 'CONT
QUIT
DO HDR(KMPDSTTL)
WRITE !
+12 WRITE ?12," ",$SELECT($LENGTH(HR)=1:"0",1:""),HR
+13 SET DATA=^TMP($JOB,KMPDSUB,DATE,HR)
+14 WRITE ?20,$JUSTIFY($FNUMBER($PIECE(DATA,U),",",0),10)
+15 WRITE ?34,$JUSTIFY($FNUMBER($PIECE(DATA,U,2),",",0),10)
+16 WRITE ?48,$JUSTIFY($FNUMBER($PIECE(DATA,U,3),",",0),10)
+17 WRITE ?62,$JUSTIFY($FNUMBER($PIECE(DATA,U,5),",",0),10)
+18 IF $PIECE(DATA,U,5)["*"
WRITE "*"
SET KMPDSTAR=1
+19 WRITE !
+20 SET $PIECE(TOTAL,U)=$PIECE(TOTAL,U)+$PIECE(DATA,U,5)
+21 SET $PIECE(TOTAL,U,2)=$PIECE(TOTAL,U,2)+$PIECE(DATA,U,6)
End DoDot:2
if 'CONT
QUIT
+22 ;
+23 ; back to DATE level
+24 ; totals
+25 WRITE ?62,"----------",!?62,$JUSTIFY($FNUMBER(TOTAL,",",0),10),!
+26 WRITE !?12,"Incomplete: ",$JUSTIFY($FNUMBER($PIECE(TOTAL,U,2),",",0),$LENGTH($PIECE(TOTAL,U,2))+2),!
+27 ; if another date
+28 IF $ORDER(^TMP($JOB,KMPDSUB,DATE))
DO CONTINUE^KMPDUTL4("",1,.CONT)
if 'CONT
QUIT
DO HDR(KMPDSTTL)
WRITE !
End DoDot:1
if 'CONT
QUIT
+29 ;
+30 IF CONT
Begin DoDot:1
+31 ; legend
+32 WRITE !!?2,"CV = Coversheet"
IF KMPDSTAR=1
WRITE ?35,"* = BG/FG Load Counts not equal."
+33 WRITE !?2,"TTL = Time-to-Load"
IF KMPDSTAR=1
WRITE ?35,"Listing FOREGROUND Load Count"
+34 ; pause if output to terminal
+35 DO CONTINUE^KMPDUTL4("Press RETURN to continue",1)
End DoDot:1
+36 ;
+37 QUIT
+38 ;
PRNTBOTH ;
+1 ; AVG ^ MIN ^ MAX ^ TOTDELTA ^ CNT
+2 NEW DATE,TOTDATA,HR,BGDATA,BGMAX,BGMIN,BGTOT,FGDATA,FGMAX,FGMIN,FGTOT
+3 SET DATE=""
+4 FOR
SET DATE=$ORDER(^TMP($JOB,"ORWCV-FT",DATE))
if DATE=""
QUIT
Begin DoDot:1
+5 SET HR=""
+6 FOR
SET HR=$ORDER(^TMP($JOB,"ORWCV-FT",DATE,HR))
if HR=""
QUIT
Begin DoDot:2
+7 SET TOTDATA=""
+8 SET FGDATA=$GET(^TMP($JOB,"ORWCV-FT",DATE,HR))
+9 SET BGDATA=$GET(^TMP($JOB,"ORWCV",DATE,HR))
+10 SET $PIECE(TOTDATA,U)=$PIECE(FGDATA,U)+$PIECE(BGDATA,U)
+11 SET FGMIN=$PIECE(FGDATA,U,2)
SET BGMIN=$PIECE(BGDATA,U,2)
+12 SET $PIECE(TOTDATA,U,2)=$SELECT(FGMIN<BGMIN:FGMIN,1:BGMIN)
+13 SET FGMAX=$PIECE(FGDATA,U,3)
SET BGMAX=$PIECE(BGDATA,U,3)
+14 SET $PIECE(TOTDATA,U,3)=$SELECT(BGMAX>FGMAX:BGMAX,1:FGMAX)
+15 SET $PIECE(TOTDATA,U,4)=$PIECE(FGDATA,U,5)+$PIECE(BGDATA,U,4)
+16 SET FGTOT=$PIECE(FGDATA,U,5)
SET BGTOT=$PIECE(BGDATA,U,5)
+17 SET $PIECE(TOTDATA,U,5)=$SELECT(FGTOT=BGTOT:FGTOT,1:FGTOT_"*")
+18 SET $PIECE(TOTDATA,U,6)=$PIECE(FGDATA,U,6)+$PIECE(BGDATA,U,6)
+19 SET ^TMP($JOB,"ORWCV-BOTH",DATE,HR)=TOTDATA
End DoDot:2
End DoDot:1
+20 DO PRINTONE("ORWCV","BACKGROUND")
+21 DO PRINTONE("ORWCV-FT","FOREGROUND")
+22 DO PRINTONE("ORWCV-BOTH","Combined FOREGROUND and BACKGROUND")
+23 QUIT
+24 ;
HDR(KMPDSTTL) ;-- print header
+1 WRITE @IOF
+2 SET X=$GET(KMPDTTL)
+3 WRITE !?(80-$LENGTH(X)\2),X
+4 SET X=KMPDSTTL_" Coversheet Loads"
+5 WRITE !?(80-$LENGTH(X)\2),X
+6 SET X=$GET(KMPDATE(0))
SET X=$PIECE(X,U,3)_" - "_$PIECE(X,U,4)
+7 WRITE !?(80-$LENGTH(X)\2),X,?61,"Printed: ",$$FMTE^XLFDT(DT,2)
+8 WRITE !
+9 WRITE !?20,"|---------------Seconds---------------|"
+10 WRITE !,"Date",?12,"Hour",?20,"TTL Average",?34,"TTL Minimum",?48,"TTL Maximum",?62,"# of CV Loads"
+11 WRITE !,$$REPEAT^XLFSTR("-",IOM)
+12 ;
+13 QUIT
+14 ;
EXIT ;-- cleanup on exit
+1 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+2 DO ^%ZISC
+3 KILL KMPDATE,KMPDTTL
+4 QUIT