KMPRUTL ;OAK/KAK/RAK - Resource Usage Monitor Utilities ;9/1/2015
;;2.0;CAPACITY MANAGEMENT - RUM;**1,2,4**;May 28, 2003;Build 41
;
GRPHMSG ;-- graph message.
N TXT
S TXT(1)="This option displays data in a graphical format. Please make"
S TXT(2)="note that this output is intended for comparison/trends only,"
S TXT(3)="and should not be used for detailed analysis."
S TXT(1,"F")="!?9",TXT(2,"F")="!?9",TXT(3,"F")="!?9"
D EN^DDIOL(.TXT)
Q
;
ID(KMPRIEN) ;-- display - called from ^DD(8971.1,0,"ID","W")
;-----------------------------------------------------------------------
; KMPRIEN... Ien for file #8971.1 (RESOURCE USAGE MONITOR).
;-----------------------------------------------------------------------
Q:'$G(KMPRIEN)
Q:'$D(^KMPR(8971.1,+KMPRIEN,0))
N DATA,TXT
S DATA=$G(^KMPR(8971.1,+KMPRIEN,0))
; sent to cm national database.
S TXT(1)=$S($P(DATA,U,2):"sent",1:"not sent")
S TXT(1)=TXT(1)_$J(" ",10-$L(TXT(1)))
; node.
S TXT(1)=TXT(1)_$P(DATA,U,3)
S TXT(1)=TXT(1)_$J(" ",22-$L(TXT(1)))
; option.
I $P(DATA,U,4)]"" S TXT(1)=TXT(1)_"option: "_$P(DATA,U,4)
; rpc.
E I $P(DATA,U,7)]"" S TXT(1)=TXT(1)_" rpc: "_$P(DATA,U,7)
S TXT(1,"F")="?16"
; if protocol
I $P(DATA,U,5)'="" D
.S TXT(2)="protocol: "_$E($P(DATA,U,5),1,40) ;_" (protocol)"
.S TXT(2,"F")="!?"_$S($G(DDSDIW):40,1:42)
; display TXT() array.
D EN^DDIOL(.TXT)
Q
;
NODEARRY(KMPRARRY) ;-- put nodes into array.
;-----------------------------------------------------------------------
; KMPRARRY.. Array to contain nodes in format:
; KMPRARRY(NODENAME)=""
;-----------------------------------------------------------------------
;
K @KMPRARRY
;
N NODE S NODE=""
F S NODE=$O(^KMPR(8971.1,"ANODE",NODE)) Q:NODE="" S @KMPRARRY@(NODE)=""
Q
;
RUMDATES(KMPRDATE) ;-- get RUM date ranges from file 8971.1
;---------------------------------------------------------------------
; KMPRDATE... Return value (access by reference) in format:
; StartDate^EndDate^ExtStartDate^ExtEndDate
; 2981101^2981104^Nov 1, 1998^Nov 4, 1998
;---------------------------------------------------------------------
;
S KMPRDATE=""
N END,START
; determine start date from file 8971.1
S START=$O(^KMPR(8971.1,"B",0))
; determine end date from file 8971.1
S END=$O(^KMPR(8971.1,"B","A"),-1)
D DATERNG^KMPRUTL1(.KMPRDATE,START,END)
;
Q
;
VERSION() ;-- extrinsic - return current version
;
Q $P($T(+2^KMPRUTL),";",3)_"^"_$P($T(+2^KMPRUTL),";",5)
;
ELEARRY(KMPRARRY) ;-- set elements data into KMPRARRY.
;-----------------------------------------------------------------------
; KMPRARRY... Array to contain elements data.
; Format: ElementName^DataPiece
; KMPRARRY(1)=CPU Time^1
; KMPRARRY(2)=Elapsed Time^7
; KMPRARRY(...)=...
;-----------------------------------------------------------------------
;
Q:$G(KMPRARRY)=""
;
N DATA,I
F I=1:1 Q:$P($T(ELEMENTS+I),";",3)="" D
.S DATA=$T(ELEMENTS+I)
.S @KMPRARRY@(I)=$P(DATA,";",3)_"^"_$P(DATA,";",4)
Q
;
ELEMENT(KMPUVAR) ;-- select RUM data element.
; Output Variable:
; KMPUVAR = Number of Data Piece
; = '^' if DTOUT or DUOUT
; KMPUVAR(0) = Set of Code's Verbiage
;
N DIR,DTOUT,DUOUT,I,X,Y
S KMPUVAR=""
S DIR(0)="SXO^"
F I=1:1 Q:$P($T(ELEMENTS+I),";",3)="" D
.S DIR(0)=DIR(0)_I_":"_$P($T(ELEMENTS+I),";",3)_";"
S DIR("A")="Enter Key Data Element for Searching RUM Data"
D ^DIR I $D(DTOUT)!$D(DUOUT)!(Y="") S KMPUVAR="^",KMPUVAR(0)="" Q
S KMPUVAR=$TR(Y,"12345678^","17562348^"),KMPUVAR(0)=Y(0)
Q
;
ELEMENTS ;-- ;;Element Name;data piece in file 8971.1
;;CPU Time;1
;;Elapsed Time;7
;;M Commands;5
;;GLO References;6
;;DIO References;2
;;BIO References;3
;;Page Faults;4
;;Occurrences;8
;;
PTCHINFO ; -- patch information: routine name ^ current version ^ current patch(es)
;;KMPRBD01^2.0^**1,2**
;;KMPRBD02^2.0^**2**
;;KMPRBD03^2.0^
;;KMPRBD04^2.0^**2**
;;KMPRBD05^2.0^**2**
;;KMPRP1^2.0^**1**
;;KMPRP2^2.0^**1**
;;KMPRPG01^2.0^**1**
;;KMPRPG02^2.0^**1**
;;KMPRPN03^2.0^**1**
;;KMPRPOST^2.0^**2**
;;KMPRSS^2.0^**1,2**
;;KMPRUTL^2.0^**1,2,4**
;;KMPRUTL1^2.0^**1,2**
;;KMPRUTL2^2.0^
;;KMPRUTL3^2.0^
;;%ZOSVKR^8.0^**90,94,107,122,143,186,550,568**
;;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPRUTL 4417 printed Oct 16, 2024@17:42:36 Page 2
KMPRUTL ;OAK/KAK/RAK - Resource Usage Monitor Utilities ;9/1/2015
+1 ;;2.0;CAPACITY MANAGEMENT - RUM;**1,2,4**;May 28, 2003;Build 41
+2 ;
GRPHMSG ;-- graph message.
+1 NEW TXT
+2 SET TXT(1)="This option displays data in a graphical format. Please make"
+3 SET TXT(2)="note that this output is intended for comparison/trends only,"
+4 SET TXT(3)="and should not be used for detailed analysis."
+5 SET TXT(1,"F")="!?9"
SET TXT(2,"F")="!?9"
SET TXT(3,"F")="!?9"
+6 DO EN^DDIOL(.TXT)
+7 QUIT
+8 ;
ID(KMPRIEN) ;-- display - called from ^DD(8971.1,0,"ID","W")
+1 ;-----------------------------------------------------------------------
+2 ; KMPRIEN... Ien for file #8971.1 (RESOURCE USAGE MONITOR).
+3 ;-----------------------------------------------------------------------
+4 if '$GET(KMPRIEN)
QUIT
+5 if '$DATA(^KMPR(8971.1,+KMPRIEN,0))
QUIT
+6 NEW DATA,TXT
+7 SET DATA=$GET(^KMPR(8971.1,+KMPRIEN,0))
+8 ; sent to cm national database.
+9 SET TXT(1)=$SELECT($PIECE(DATA,U,2):"sent",1:"not sent")
+10 SET TXT(1)=TXT(1)_$JUSTIFY(" ",10-$LENGTH(TXT(1)))
+11 ; node.
+12 SET TXT(1)=TXT(1)_$PIECE(DATA,U,3)
+13 SET TXT(1)=TXT(1)_$JUSTIFY(" ",22-$LENGTH(TXT(1)))
+14 ; option.
+15 IF $PIECE(DATA,U,4)]""
SET TXT(1)=TXT(1)_"option: "_$PIECE(DATA,U,4)
+16 ; rpc.
+17 IF '$TEST
IF $PIECE(DATA,U,7)]""
SET TXT(1)=TXT(1)_" rpc: "_$PIECE(DATA,U,7)
+18 SET TXT(1,"F")="?16"
+19 ; if protocol
+20 IF $PIECE(DATA,U,5)'=""
Begin DoDot:1
+21 ;_" (protocol)"
SET TXT(2)="protocol: "_$EXTRACT($PIECE(DATA,U,5),1,40)
+22 SET TXT(2,"F")="!?"_$SELECT($GET(DDSDIW):40,1:42)
End DoDot:1
+23 ; display TXT() array.
+24 DO EN^DDIOL(.TXT)
+25 QUIT
+26 ;
NODEARRY(KMPRARRY) ;-- put nodes into array.
+1 ;-----------------------------------------------------------------------
+2 ; KMPRARRY.. Array to contain nodes in format:
+3 ; KMPRARRY(NODENAME)=""
+4 ;-----------------------------------------------------------------------
+5 ;
+6 KILL @KMPRARRY
+7 ;
+8 NEW NODE
SET NODE=""
+9 FOR
SET NODE=$ORDER(^KMPR(8971.1,"ANODE",NODE))
if NODE=""
QUIT
SET @KMPRARRY@(NODE)=""
+10 QUIT
+11 ;
RUMDATES(KMPRDATE) ;-- get RUM date ranges from file 8971.1
+1 ;---------------------------------------------------------------------
+2 ; KMPRDATE... Return value (access by reference) in format:
+3 ; StartDate^EndDate^ExtStartDate^ExtEndDate
+4 ; 2981101^2981104^Nov 1, 1998^Nov 4, 1998
+5 ;---------------------------------------------------------------------
+6 ;
+7 SET KMPRDATE=""
+8 NEW END,START
+9 ; determine start date from file 8971.1
+10 SET START=$ORDER(^KMPR(8971.1,"B",0))
+11 ; determine end date from file 8971.1
+12 SET END=$ORDER(^KMPR(8971.1,"B","A"),-1)
+13 DO DATERNG^KMPRUTL1(.KMPRDATE,START,END)
+14 ;
+15 QUIT
+16 ;
VERSION() ;-- extrinsic - return current version
+1 ;
+2 QUIT $PIECE($TEXT(+2^KMPRUTL),";",3)_"^"_$PIECE($TEXT(+2^KMPRUTL),";",5)
+3 ;
ELEARRY(KMPRARRY) ;-- set elements data into KMPRARRY.
+1 ;-----------------------------------------------------------------------
+2 ; KMPRARRY... Array to contain elements data.
+3 ; Format: ElementName^DataPiece
+4 ; KMPRARRY(1)=CPU Time^1
+5 ; KMPRARRY(2)=Elapsed Time^7
+6 ; KMPRARRY(...)=...
+7 ;-----------------------------------------------------------------------
+8 ;
+9 if $GET(KMPRARRY)=""
QUIT
+10 ;
+11 NEW DATA,I
+12 FOR I=1:1
if $PIECE($TEXT(ELEMENTS+I),";",3)=""
QUIT
Begin DoDot:1
+13 SET DATA=$TEXT(ELEMENTS+I)
+14 SET @KMPRARRY@(I)=$PIECE(DATA,";",3)_"^"_$PIECE(DATA,";",4)
End DoDot:1
+15 QUIT
+16 ;
ELEMENT(KMPUVAR) ;-- select RUM data element.
+1 ; Output Variable:
+2 ; KMPUVAR = Number of Data Piece
+3 ; = '^' if DTOUT or DUOUT
+4 ; KMPUVAR(0) = Set of Code's Verbiage
+5 ;
+6 NEW DIR,DTOUT,DUOUT,I,X,Y
+7 SET KMPUVAR=""
+8 SET DIR(0)="SXO^"
+9 FOR I=1:1
if $PIECE($TEXT(ELEMENTS+I),";",3)=""
QUIT
Begin DoDot:1
+10 SET DIR(0)=DIR(0)_I_":"_$PIECE($TEXT(ELEMENTS+I),";",3)_";"
End DoDot:1
+11 SET DIR("A")="Enter Key Data Element for Searching RUM Data"
+12 DO ^DIR
IF $DATA(DTOUT)!$DATA(DUOUT)!(Y="")
SET KMPUVAR="^"
SET KMPUVAR(0)=""
QUIT
+13 SET KMPUVAR=$TRANSLATE(Y,"12345678^","17562348^")
SET KMPUVAR(0)=Y(0)
+14 QUIT
+15 ;
ELEMENTS ;-- ;;Element Name;data piece in file 8971.1
+1 ;;CPU Time;1
+2 ;;Elapsed Time;7
+3 ;;M Commands;5
+4 ;;GLO References;6
+5 ;;DIO References;2
+6 ;;BIO References;3
+7 ;;Page Faults;4
+8 ;;Occurrences;8
+9 ;;
PTCHINFO ; -- patch information: routine name ^ current version ^ current patch(es)
+1 ;;KMPRBD01^2.0^**1,2**
+2 ;;KMPRBD02^2.0^**2**
+3 ;;KMPRBD03^2.0^
+4 ;;KMPRBD04^2.0^**2**
+5 ;;KMPRBD05^2.0^**2**
+6 ;;KMPRP1^2.0^**1**
+7 ;;KMPRP2^2.0^**1**
+8 ;;KMPRPG01^2.0^**1**
+9 ;;KMPRPG02^2.0^**1**
+10 ;;KMPRPN03^2.0^**1**
+11 ;;KMPRPOST^2.0^**2**
+12 ;;KMPRSS^2.0^**1,2**
+13 ;;KMPRUTL^2.0^**1,2,4**
+14 ;;KMPRUTL1^2.0^**1,2**
+15 ;;KMPRUTL2^2.0^
+16 ;;KMPRUTL3^2.0^
+17 ;;%ZOSVKR^8.0^**90,94,107,122,143,186,550,568**
+18 ;;