KMPRPT ;OAK/RAK - RUM Data by Option/Protocol/RPC ;12/2/05 10:01
;;2.0;CAPACITY MANAGEMENT - RUM;**2**;May 28, 2003;Build 12
EN ;-- entry point.
;
N %ZIS,KMPRDATE,KMPRNODE,KMPROPT,KMPRTTL,OUT,POP,X,Y
N ZTDESC,ZTRTN,ZTSAVE,ZTSK
;
; title
S KMPRTTL=" RUM Test Lab Data "
D HDR^KMPDUTL4(KMPRTTL)
; select date
S KMPRDATE=$$DATE Q:KMPRDATE=""
; node
S KMPRNODE=$P(KMPRDATE,U,2) Q:KMPRNODE=""
S KMPRDATE=$P(KMPRDATE,U,3) Q:'KMPRDATE
; select option
W ! S KMPROPT=$$OPTION(KMPRNODE,KMPRDATE)
I KMPROPT="" W $C(7),!?3,"No Options for this Date!" Q
; 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=KMPRTTL
.S ZTRTN="EN1^KMPRPT"
.S ZTSAVE("KMPRDATE")="",ZTSAVE("KMPRNODE")="",ZTSAVE("KMPROPT")=""
.S ZTSAVE("KMPRTTL")=""
.D ^%ZTLOAD W:$G(ZTSK) !,"Task #",ZTSK
.D EXIT
;
; if output to terminal display message.
W:$E(IOST,1,2)="C-" !?3,"compiling data..."
D EN1
;
Q
;
EN1 ;-- entry point from taskman.
;
Q:'$G(KMPRDATE)
Q:$G(KMPRNODE)=""
Q:$G(KMPROPT)=""
;
S KMPRTTL=$G(KMPRTTL)
;
K ^TMP($J)
D DATA,PRINT,EXIT
K ^TMP($J)
;
Q
;
DATA ;-- set data into KMPRARRY
;
Q:'$G(KMPRDATE)
Q:$G(KMPRNODE)=""
Q:$G(KMPROPT)=""
;
N CNT,CONT,DATA,DATE,FMHDATE,HDATE,HR,I,JOB,LAB,MINUTES,OPT,OPTION,QUIET
;
S QUIET=$D(ZTQUEUED)
;
K ^TMP($J)
S FMHDATE=+$$HTFM^XLFDT(KMPRDATE,1)
;
S HR=""
F S HR=$O(^KMPTMP("KMPR","DLY",KMPRNODE,KMPRDATE,HR)) Q:HR="" D
.S OPTION=""
.F S OPTION=$O(^KMPTMP("KMPR","DLY",KMPRNODE,KMPRDATE,HR,OPTION)) Q:OPTION="" D
..S OPT=$$OPT(OPTION) Q:OPTION=""
..Q:OPT'=KMPROPT
..S JOB=0
..F S JOB=$O(^KMPTMP("KMPR","DLY",KMPRNODE,KMPRDATE,HR,OPTION,JOB)) Q:'JOB D
...;
...S DATA=^KMPTMP("KMPR","DLY",KMPRNODE,KMPRDATE,HR,OPTION,JOB)
...S MINUTES=$P(DATA,U,10,999)
...;
...S LAB=""
...; if current data is negative
...I $P(LAB,U,5)<0 D
....S $P(^KMPTMP("KMPR","NEG","DLY",OPTION,"C"),U,5)=$P(LAB,U,5)
...;
...; if new data is negative
...I ($P(DATA,U,5)<0) D
....S $P(^KMPTMP("KMPR","NEG","DLY",OPTION,"N"),U,5)=$P(DATA,U,5)
...;
...; if sum of pieces are negative
...I ($P(LAB,U,5)+$P(DATA,U,5))<0 D
....S $P(^KMPTMP("KMPR","NEG","DLY",OPTION,"T"),U,5)=($P(LAB,U,5))_"+"_($P(DATA,U,5))_"="_($P(LAB,U,5)+$P(DATA,U,5))
...;
...; accumulate totals
...; data elements - pieces 1 - 8
...F I=1:1:8 S $P(LAB,U,I)=$P($G(LAB),U,I)+$P(DATA,U,I)
...;
...; CNT(1) = minutes 0 = 29
...; CNT(2) = minutes 30 = 59
...F I=1:1:30 S $P(CNT(1),U,I)=$P(MINUTES,U,I)
...F I=31:1:60 S $P(CNT(2),U,(I-30))=$P(MINUTES,U,I)
...;
...S ^TMP($J,FMHDATE,KMPRNODE,OPT,HR)=LAB
...F I=1:1:30 S $P(^TMP($J,FMHDATE,KMPRNODE,OPT,HR,1),U,I)=$P($G(^TMP($J,FMHDATE,KMPRNODE,OPT,HR,1)),U,I)+$P(CNT(1),U,I)
...F I=1:1:30 S $P(^TMP($J,FMHDATE,KMPRNODE,OPT,HR,2),U,I)=$P($G(^TMP($J,FMHDATE,KMPRNODE,OPT,HR,2)),U,I)+$P(CNT(2),U,I)
...W:'QUIET "."
;
Q
;
PRINT ;
;
N DATA,DATE,ELEMENTS,HR,MINUTES,NODE,OCCUR,OPTION
I '$D(^TMP($J)) W !?3,"No Data to Report!" W @IOF,!?($L(KMPRTTL)\2),KMPRTTL,! Q
;
S DATE=0,CONT=1
F S DATE=$O(^TMP($J,DATE)) Q:'DATE S NODE="" D Q:'CONT
.F S NODE=$O(^TMP($J,DATE,NODE)) Q:NODE="" S OPTION="" D Q:'CONT
..F S OPTION=$O(^TMP($J,DATE,NODE,OPTION)) Q:OPTION="" S HR=0 D Q:'CONT
...D HDR
...F S HR=$O(^TMP($J,DATE,NODE,OPTION,HR)) Q:'HR D Q:'CONT
....Q:'$D(^TMP($J,DATE,NODE,OPTION,HR))#10 S DATA=^(HR)
....S ELEMENTS=$P(DATA,U,1,8)
....S OCCUR=$P(DATA,U,8)
....S MINUTES=$P(DATA,U,10,99)
....W !,$J(HR,3)
....W ?6,$J($FN($S($P(ELEMENTS,U):$P(ELEMENTS,U)/OCCUR,1:$P(ELEMENTS,U)),",",1),5)
....W ?14,$J($FN($S($P(ELEMENTS,U,2):$P(ELEMENTS,U,2)/OCCUR,1:$P(ELEMENTS,U,2)),",",1),5)
....W ?22,$J($FN($S($P(ELEMENTS,U,3):$P(ELEMENTS,U,3)/OCCUR,1:$P(ELEMENTS,U,3)),",",1),5)
....W ?30,$J($FN($S($P(ELEMENTS,U,4):$P(ELEMENTS,U,4)/OCCUR,1:$P(ELEMENTS,U,4)),",",1),5)
....W ?41,$J($FN($S($P(ELEMENTS,U,5):$P(ELEMENTS,U,5)/OCCUR,1:$P(ELEMENTS,U,5)),",",1),10)
....W ?53,$J($FN($S($P(ELEMENTS,U,6):$P(ELEMENTS,U,6)/OCCUR,1:$P(ELEMENTS,U,6)),",",1),10)
....; elapsed time in hr:mn:sc format
....S X=$S($P(ELEMENTS,U,7):$P(ELEMENTS,U,7)/OCCUR,1:$P(ELEMENTS,U,7))
....W ?65,$J($FN($$TIME(X),",",1),8)
....W ?75,$J(OCCUR,3)
...D CONTINUE^KMPDUTL4("Press RETURN to continue",3,.CONT)
Q
;
EXIT ;--cleanup
S:$D(ZTQUEUED) ZTREQ="@"
K KMPRDATE,KMPRNODE,KMPROPT,KMPRTTL
;
Q
;
DATE() ;--extrinsic function - select list of dates
;-----------------------------------------------------------------------------
; Return: FileManExternalDate^NodeName^$HDate
; "" - no entry selected
;-----------------------------------------------------------------------------
N CNT,DIC,DOT,FMDT,HDT,NODE,X,Y
K ^TMP("KMPRPT-LIST",$J)
S NODE="",(CNT,DOT)=0
F S NODE=$O(^KMPTMP("KMPR","DLY",NODE)) Q:NODE="" S HDT=0 D
.F S HDT=$O(^KMPTMP("KMPR","DLY",NODE,HDT)) Q:'HDT D
..S FMDT=$$FMTE^XLFDT($$HTFM^XLFDT(HDT))
..S CNT=CNT+1,DOT=DOT+1 W:'(DOT#100) "."
..S ^TMP("KMPRPT-LIST",$J,CNT,0)=FMDT_"^"_NODE_"^"_HDT
..S ^TMP("KMPRPT-LIST",$J,"B",FMDT,CNT)=""
S ^TMP("KMPRPT-LIST",$J,0)="RUM Date^1.01^"_CNT_"^"_CNT
S DIC="^TMP(""KMPRPT-LIST"",$J,"
S DIC(0)="E",X="?" D ^DIC
S DIC(0)="AEQZ"
S DIC("A")="Select RUM Date: "
S DIC("W")="W "" - ""_$P(^(0),U,2)"
D ^DIC
K ^TMP("KMPRPT-LIST",$J)
Q $S(Y<1:"",1:$G(Y(0)))
Q
Q ""
;
HDR ;--header info
W @IOF
W ?((80-$L(KMPRTTL))\2),KMPRTTL
S X=$$FMTE^XLFDT(DATE)
W !?((80-$L(X))\2),X
S X="Option: "_OPTION_" Node: "_NODE
W !?((80-$L(X)\2)),X
;S X="Option: "_OPTION
;W !?((80-$L(X))\2),X
W !
W !?3,"|---------------------------Per Occurrence------------------------|"
W !,"Hour",?6," CPU",?14," DIO",?22," BIO",?30," Page",?41,"M Commands",?53," Global",?65,"Elapsed",?75,"Occ"
W !?6,"Time",?30,"Faults",?53,"References",?65," Time"
W !,$$REPEAT^XLFSTR("-",IOM)
;
;
OPTION(KMPRNODE,KMPRDATE) ;--extrinsic function - select list of options to display
;-----------------------------------------------------------------------------
; KMPRNODE... node
; KMPRDATE... date in $h format
;
; Return: FileManExternalDate^NodeName^$HDate
; "" - no entry selected
;-----------------------------------------------------------------------------
Q:'$G(KMPRDATE) ""
Q:$G(KMPRNODE)="" ""
N CNT,DIC,DOT,FMDT,HDT,NODE,X,Y
K ^TMP("KMPRPT-LIST",$J)
S HR="",(CNT,DOT)=0
F S HR=$O(^KMPTMP("KMPR","DLY",KMPRNODE,KMPRDATE,HR)) Q:HR="" S OPTION="" D
.F S OPTION=$O(^KMPTMP("KMPR","DLY",KMPRNODE,KMPRDATE,HR,OPTION)) Q:OPTION="" D
..S OPT=$$OPT(OPTION) Q:OPT=""
..Q:$O(^TMP("KMPRPT-LIST",$J,"B",OPT,0))
..S CNT=CNT+1,DOT=DOT+1 W:'(DOT#100) "."
..S ^TMP("KMPRPT-LIST",$J,CNT,0)=OPT
..S ^TMP("KMPRPT-LIST",$J,"B",OPT,CNT)=""
;
Q:'CNT ""
S ^TMP("KMPRPT-LIST",$J,0)="RUM Option^1.01^"_CNT_"^"_CNT
S DIC="^TMP(""KMPRPT-LIST"",$J,"
S DIC(0)="E",X="??" D ^DIC
S DIC(0)="AEQZ"
S DIC("A")="Select RUM Option: "
D ^DIC
K ^TMP("KMPRPT-LIST",$J)
Q $S(Y<1:"",1:$G(Y(0)))
;
OPT(KMPROPT) ;--extrinsic function - option name
;-----------------------------------------------------------------------------
; KMPROPT... option name as stored in ^KMPTMP("KMPR","DLY"
;
; Return: OptionName
; "" - if not option
;-----------------------------------------------------------------------------
Q:$G(KMPROPT)="" ""
; quit if protocol
Q:$E(KMPROPT)="!" ""
; quit if job queued
Q:$E(KMPROPT)="$" ""
Q $P(KMPROPT,"***")
;
TIME(X) ;-- extrinsic function - display time as hr:mn:sc
Q:'$G(X) 0
N %
S %=X,X="" S:%'<86400 X=(%\86400) S:%#86400 X=X_" "_(%#86400\3600)_":"_$E(%#3600\60+100,2,3)_":"_$E(%#60+100,2,3)
Q X
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPRPT 7860 printed Dec 13, 2024@01:41:43 Page 2
KMPRPT ;OAK/RAK - RUM Data by Option/Protocol/RPC ;12/2/05 10:01
+1 ;;2.0;CAPACITY MANAGEMENT - RUM;**2**;May 28, 2003;Build 12
EN ;-- entry point.
+1 ;
+2 NEW %ZIS,KMPRDATE,KMPRNODE,KMPROPT,KMPRTTL,OUT,POP,X,Y
+3 NEW ZTDESC,ZTRTN,ZTSAVE,ZTSK
+4 ;
+5 ; title
+6 SET KMPRTTL=" RUM Test Lab Data "
+7 DO HDR^KMPDUTL4(KMPRTTL)
+8 ; select date
+9 SET KMPRDATE=$$DATE
if KMPRDATE=""
QUIT
+10 ; node
+11 SET KMPRNODE=$PIECE(KMPRDATE,U,2)
if KMPRNODE=""
QUIT
+12 SET KMPRDATE=$PIECE(KMPRDATE,U,3)
if 'KMPRDATE
QUIT
+13 ; select option
+14 WRITE !
SET KMPROPT=$$OPTION(KMPRNODE,KMPRDATE)
+15 IF KMPROPT=""
WRITE $CHAR(7),!?3,"No Options for this Date!"
QUIT
+16 ; select output device.
+17 SET %ZIS="Q"
SET %ZIS("A")="Device: "
SET %ZIS("B")="HOME"
+18 WRITE !
DO ^%ZIS
IF POP
WRITE !,"No action taken."
QUIT
+19 ; if queued.
+20 IF $DATA(IO("Q"))
KILL IO("Q")
Begin DoDot:1
+21 SET ZTDESC=KMPRTTL
+22 SET ZTRTN="EN1^KMPRPT"
+23 SET ZTSAVE("KMPRDATE")=""
SET ZTSAVE("KMPRNODE")=""
SET ZTSAVE("KMPROPT")=""
+24 SET ZTSAVE("KMPRTTL")=""
+25 DO ^%ZTLOAD
if $GET(ZTSK)
WRITE !,"Task #",ZTSK
+26 DO EXIT
End DoDot:1
QUIT
+27 ;
+28 ; if output to terminal display message.
+29 if $EXTRACT(IOST,1,2)="C-"
WRITE !?3,"compiling data..."
+30 DO EN1
+31 ;
+32 QUIT
+33 ;
EN1 ;-- entry point from taskman.
+1 ;
+2 if '$GET(KMPRDATE)
QUIT
+3 if $GET(KMPRNODE)=""
QUIT
+4 if $GET(KMPROPT)=""
QUIT
+5 ;
+6 SET KMPRTTL=$GET(KMPRTTL)
+7 ;
+8 KILL ^TMP($JOB)
+9 DO DATA
DO PRINT
DO EXIT
+10 KILL ^TMP($JOB)
+11 ;
+12 QUIT
+13 ;
DATA ;-- set data into KMPRARRY
+1 ;
+2 if '$GET(KMPRDATE)
QUIT
+3 if $GET(KMPRNODE)=""
QUIT
+4 if $GET(KMPROPT)=""
QUIT
+5 ;
+6 NEW CNT,CONT,DATA,DATE,FMHDATE,HDATE,HR,I,JOB,LAB,MINUTES,OPT,OPTION,QUIET
+7 ;
+8 SET QUIET=$DATA(ZTQUEUED)
+9 ;
+10 KILL ^TMP($JOB)
+11 SET FMHDATE=+$$HTFM^XLFDT(KMPRDATE,1)
+12 ;
+13 SET HR=""
+14 FOR
SET HR=$ORDER(^KMPTMP("KMPR","DLY",KMPRNODE,KMPRDATE,HR))
if HR=""
QUIT
Begin DoDot:1
+15 SET OPTION=""
+16 FOR
SET OPTION=$ORDER(^KMPTMP("KMPR","DLY",KMPRNODE,KMPRDATE,HR,OPTION))
if OPTION=""
QUIT
Begin DoDot:2
+17 SET OPT=$$OPT(OPTION)
if OPTION=""
QUIT
+18 if OPT'=KMPROPT
QUIT
+19 SET JOB=0
+20 FOR
SET JOB=$ORDER(^KMPTMP("KMPR","DLY",KMPRNODE,KMPRDATE,HR,OPTION,JOB))
if 'JOB
QUIT
Begin DoDot:3
+21 ;
+22 SET DATA=^KMPTMP("KMPR","DLY",KMPRNODE,KMPRDATE,HR,OPTION,JOB)
+23 SET MINUTES=$PIECE(DATA,U,10,999)
+24 ;
+25 SET LAB=""
+26 ; if current data is negative
+27 IF $PIECE(LAB,U,5)<0
Begin DoDot:4
+28 SET $PIECE(^KMPTMP("KMPR","NEG","DLY",OPTION,"C"),U,5)=$PIECE(LAB,U,5)
End DoDot:4
+29 ;
+30 ; if new data is negative
+31 IF ($PIECE(DATA,U,5)<0)
Begin DoDot:4
+32 SET $PIECE(^KMPTMP("KMPR","NEG","DLY",OPTION,"N"),U,5)=$PIECE(DATA,U,5)
End DoDot:4
+33 ;
+34 ; if sum of pieces are negative
+35 IF ($PIECE(LAB,U,5)+$PIECE(DATA,U,5))<0
Begin DoDot:4
+36 SET $PIECE(^KMPTMP("KMPR","NEG","DLY",OPTION,"T"),U,5)=($PIECE(LAB,U,5))_"+"_($PIECE(DATA,U,5))_"="_($PIECE(LAB,U,5)+$PIECE(DATA,U,5))
End DoDot:4
+37 ;
+38 ; accumulate totals
+39 ; data elements - pieces 1 - 8
+40 FOR I=1:1:8
SET $PIECE(LAB,U,I)=$PIECE($GET(LAB),U,I)+$PIECE(DATA,U,I)
+41 ;
+42 ; CNT(1) = minutes 0 = 29
+43 ; CNT(2) = minutes 30 = 59
+44 FOR I=1:1:30
SET $PIECE(CNT(1),U,I)=$PIECE(MINUTES,U,I)
+45 FOR I=31:1:60
SET $PIECE(CNT(2),U,(I-30))=$PIECE(MINUTES,U,I)
+46 ;
+47 SET ^TMP($JOB,FMHDATE,KMPRNODE,OPT,HR)=LAB
+48 FOR I=1:1:30
SET $PIECE(^TMP($JOB,FMHDATE,KMPRNODE,OPT,HR,1),U,I)=$PIECE($GET(^TMP($JOB,FMHDATE,KMPRNODE,OPT,HR,1)),U,I)+$PIECE(CNT(1),U,I)
+49 FOR I=1:1:30
SET $PIECE(^TMP($JOB,FMHDATE,KMPRNODE,OPT,HR,2),U,I)=$PIECE($GET(^TMP($JOB,FMHDATE,KMPRNODE,OPT,HR,2)),U,I)+$PIECE(CNT(2),U,I)
+50 if 'QUIET
WRITE "."
End DoDot:3
End DoDot:2
End DoDot:1
+51 ;
+52 QUIT
+53 ;
PRINT ;
+1 ;
+2 NEW DATA,DATE,ELEMENTS,HR,MINUTES,NODE,OCCUR,OPTION
+3 IF '$DATA(^TMP($JOB))
WRITE !?3,"No Data to Report!"
WRITE @IOF,!?($LENGTH(KMPRTTL)\2),KMPRTTL,!
QUIT
+4 ;
+5 SET DATE=0
SET CONT=1
+6 FOR
SET DATE=$ORDER(^TMP($JOB,DATE))
if 'DATE
QUIT
SET NODE=""
Begin DoDot:1
+7 FOR
SET NODE=$ORDER(^TMP($JOB,DATE,NODE))
if NODE=""
QUIT
SET OPTION=""
Begin DoDot:2
+8 FOR
SET OPTION=$ORDER(^TMP($JOB,DATE,NODE,OPTION))
if OPTION=""
QUIT
SET HR=0
Begin DoDot:3
+9 DO HDR
+10 FOR
SET HR=$ORDER(^TMP($JOB,DATE,NODE,OPTION,HR))
if 'HR
QUIT
Begin DoDot:4
+11 if '$DATA(^TMP($JOB,DATE,NODE,OPTION,HR))#10
QUIT
SET DATA=^(HR)
+12 SET ELEMENTS=$PIECE(DATA,U,1,8)
+13 SET OCCUR=$PIECE(DATA,U,8)
+14 SET MINUTES=$PIECE(DATA,U,10,99)
+15 WRITE !,$JUSTIFY(HR,3)
+16 WRITE ?6,$JUSTIFY($FNUMBER($SELECT($PIECE(ELEMENTS,U):$PIECE(ELEMENTS,U)/OCCUR,1:$PIECE(ELEMENTS,U)),",",1),5)
+17 WRITE ?14,$JUSTIFY($FNUMBER($SELECT($PIECE(ELEMENTS,U,2):$PIECE(ELEMENTS,U,2)/OCCUR,1:$PIECE(ELEMENTS,U,2)),",",1),5)
+18 WRITE ?22,$JUSTIFY($FNUMBER($SELECT($PIECE(ELEMENTS,U,3):$PIECE(ELEMENTS,U,3)/OCCUR,1:$PIECE(ELEMENTS,U,3)),",",1),5)
+19 WRITE ?30,$JUSTIFY($FNUMBER($SELECT($PIECE(ELEMENTS,U,4):$PIECE(ELEMENTS,U,4)/OCCUR,1:$PIECE(ELEMENTS,U,4)),",",1),5)
+20 WRITE ?41,$JUSTIFY($FNUMBER($SELECT($PIECE(ELEMENTS,U,5):$PIECE(ELEMENTS,U,5)/OCCUR,1:$PIECE(ELEMENTS,U,5)),",",1),10)
+21 WRITE ?53,$JUSTIFY($FNUMBER($SELECT($PIECE(ELEMENTS,U,6):$PIECE(ELEMENTS,U,6)/OCCUR,1:$PIECE(ELEMENTS,U,6)),",",1),10)
+22 ; elapsed time in hr:mn:sc format
+23 SET X=$SELECT($PIECE(ELEMENTS,U,7):$PIECE(ELEMENTS,U,7)/OCCUR,1:$PIECE(ELEMENTS,U,7))
+24 WRITE ?65,$JUSTIFY($FNUMBER($$TIME(X),",",1),8)
+25 WRITE ?75,$JUSTIFY(OCCUR,3)
End DoDot:4
if 'CONT
QUIT
+26 DO CONTINUE^KMPDUTL4("Press RETURN to continue",3,.CONT)
End DoDot:3
if 'CONT
QUIT
End DoDot:2
if 'CONT
QUIT
End DoDot:1
if 'CONT
QUIT
+27 QUIT
+28 ;
EXIT ;--cleanup
+1 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+2 KILL KMPRDATE,KMPRNODE,KMPROPT,KMPRTTL
+3 ;
+4 QUIT
+5 ;
DATE() ;--extrinsic function - select list of dates
+1 ;-----------------------------------------------------------------------------
+2 ; Return: FileManExternalDate^NodeName^$HDate
+3 ; "" - no entry selected
+4 ;-----------------------------------------------------------------------------
+5 NEW CNT,DIC,DOT,FMDT,HDT,NODE,X,Y
+6 KILL ^TMP("KMPRPT-LIST",$JOB)
+7 SET NODE=""
SET (CNT,DOT)=0
+8 FOR
SET NODE=$ORDER(^KMPTMP("KMPR","DLY",NODE))
if NODE=""
QUIT
SET HDT=0
Begin DoDot:1
+9 FOR
SET HDT=$ORDER(^KMPTMP("KMPR","DLY",NODE,HDT))
if 'HDT
QUIT
Begin DoDot:2
+10 SET FMDT=$$FMTE^XLFDT($$HTFM^XLFDT(HDT))
+11 SET CNT=CNT+1
SET DOT=DOT+1
if '(DOT#100)
WRITE "."
+12 SET ^TMP("KMPRPT-LIST",$JOB,CNT,0)=FMDT_"^"_NODE_"^"_HDT
+13 SET ^TMP("KMPRPT-LIST",$JOB,"B",FMDT,CNT)=""
End DoDot:2
End DoDot:1
+14 SET ^TMP("KMPRPT-LIST",$JOB,0)="RUM Date^1.01^"_CNT_"^"_CNT
+15 SET DIC="^TMP(""KMPRPT-LIST"",$J,"
+16 SET DIC(0)="E"
SET X="?"
DO ^DIC
+17 SET DIC(0)="AEQZ"
+18 SET DIC("A")="Select RUM Date: "
+19 SET DIC("W")="W "" - ""_$P(^(0),U,2)"
+20 DO ^DIC
+21 KILL ^TMP("KMPRPT-LIST",$JOB)
+22 QUIT $SELECT(Y<1:"",1:$GET(Y(0)))
+23 QUIT
+24 QUIT ""
+25 ;
HDR ;--header info
+1 WRITE @IOF
+2 WRITE ?((80-$LENGTH(KMPRTTL))\2),KMPRTTL
+3 SET X=$$FMTE^XLFDT(DATE)
+4 WRITE !?((80-$LENGTH(X))\2),X
+5 SET X="Option: "_OPTION_" Node: "_NODE
+6 WRITE !?((80-$LENGTH(X)\2)),X
+7 ;S X="Option: "_OPTION
+8 ;W !?((80-$L(X))\2),X
+9 WRITE !
+10 WRITE !?3,"|---------------------------Per Occurrence------------------------|"
+11 WRITE !,"Hour",?6," CPU",?14," DIO",?22," BIO",?30," Page",?41,"M Commands",?53," Global",?65,"Elapsed",?75,"Occ"
+12 WRITE !?6,"Time",?30,"Faults",?53,"References",?65," Time"
+13 WRITE !,$$REPEAT^XLFSTR("-",IOM)
+14 ;
+15 ;
OPTION(KMPRNODE,KMPRDATE) ;--extrinsic function - select list of options to display
+1 ;-----------------------------------------------------------------------------
+2 ; KMPRNODE... node
+3 ; KMPRDATE... date in $h format
+4 ;
+5 ; Return: FileManExternalDate^NodeName^$HDate
+6 ; "" - no entry selected
+7 ;-----------------------------------------------------------------------------
+8 if '$GET(KMPRDATE)
QUIT ""
+9 if $GET(KMPRNODE)=""
QUIT ""
+10 NEW CNT,DIC,DOT,FMDT,HDT,NODE,X,Y
+11 KILL ^TMP("KMPRPT-LIST",$JOB)
+12 SET HR=""
SET (CNT,DOT)=0
+13 FOR
SET HR=$ORDER(^KMPTMP("KMPR","DLY",KMPRNODE,KMPRDATE,HR))
if HR=""
QUIT
SET OPTION=""
Begin DoDot:1
+14 FOR
SET OPTION=$ORDER(^KMPTMP("KMPR","DLY",KMPRNODE,KMPRDATE,HR,OPTION))
if OPTION=""
QUIT
Begin DoDot:2
+15 SET OPT=$$OPT(OPTION)
if OPT=""
QUIT
+16 if $ORDER(^TMP("KMPRPT-LIST",$JOB,"B",OPT,0))
QUIT
+17 SET CNT=CNT+1
SET DOT=DOT+1
if '(DOT#100)
WRITE "."
+18 SET ^TMP("KMPRPT-LIST",$JOB,CNT,0)=OPT
+19 SET ^TMP("KMPRPT-LIST",$JOB,"B",OPT,CNT)=""
End DoDot:2
End DoDot:1
+20 ;
+21 if 'CNT
QUIT ""
+22 SET ^TMP("KMPRPT-LIST",$JOB,0)="RUM Option^1.01^"_CNT_"^"_CNT
+23 SET DIC="^TMP(""KMPRPT-LIST"",$J,"
+24 SET DIC(0)="E"
SET X="??"
DO ^DIC
+25 SET DIC(0)="AEQZ"
+26 SET DIC("A")="Select RUM Option: "
+27 DO ^DIC
+28 KILL ^TMP("KMPRPT-LIST",$JOB)
+29 QUIT $SELECT(Y<1:"",1:$GET(Y(0)))
+30 ;
OPT(KMPROPT) ;--extrinsic function - option name
+1 ;-----------------------------------------------------------------------------
+2 ; KMPROPT... option name as stored in ^KMPTMP("KMPR","DLY"
+3 ;
+4 ; Return: OptionName
+5 ; "" - if not option
+6 ;-----------------------------------------------------------------------------
+7 if $GET(KMPROPT)=""
QUIT ""
+8 ; quit if protocol
+9 if $EXTRACT(KMPROPT)="!"
QUIT ""
+10 ; quit if job queued
+11 if $EXTRACT(KMPROPT)="$"
QUIT ""
+12 QUIT $PIECE(KMPROPT,"***")
+13 ;
TIME(X) ;-- extrinsic function - display time as hr:mn:sc
+1 if '$GET(X)
QUIT 0
+2 NEW %
+3 SET %=X
SET X=""
if %'<86400
SET X=(%\86400)
if %#86400
SET X=X_" "_(%#86400\3600)_":"_$EXTRACT(%#3600\60+100,2,3)_":"_$EXTRACT(%#60+100,2,3)
+4 QUIT X