KMPDUTL6 ;OIFO/RAK - CPU Utilities ;2/17/04 10:58
;;3.0;KMPD;;Jan 22, 2009;Build 42
;;
CPUDEL ;-- delete cpu data from file #8973 - cp parameters
;
N DA,DIK,X,Y
;
S DA(1)=$O(^KMPD(8973,0)) Q:'DA(1)
S DIK="^KMPD(8973,"_DA(1)_",20,"
F DA=0:0 S DA=$O(^KMPD(8973,DA(1),20,DA)) Q:'DA D ^DIK
;
Q
;
CPUGET(KMPDARRY) ;--get cpu data
;-----------------------------------------------------------------------
; KMPDARRY... Return array (passed by reference) in format:
; KMPDARRY(1)=Node
;-----------------------------------------------------------------------
;
K KMPDARRY
Q:$G(^KMPD(8973,1,20,0))=""
M KMPDARRY=^KMPD(8973,1,20)
;
Q
;
CPUSET(KMPDLT) ;-- set cpu info into file #8973 cp parameters
;---------------------------------------------------------------------
; KMPDLT... Delete previous entries
; 0 - do not delete
; 1 - delete
;---------------------------------------------------------------------
;
S KMPDLT=+$G(KMPDLT)
;
N CPU,IEN,ERROR,FDA,NODE,ZIEN
;
; delete current CPU entries
D:KMPDLT CPUDEL
;
S IEN=$O(^KMPD(8973,0)) Q:'IEN
; get cpu data
D CPU^KMPDUTL5(.CPU) Q:'$D(CPU)
; file cpu data
S NODE=""
F S NODE=$O(CPU(NODE)) Q:NODE="" D
.K FDA,ERROR,ZIEN
.S FDA($J,8973.201,"?+1,"_IEN_",",.01)=NODE
.S FDA($J,8973.201,"?+1,"_IEN_",",.02)=$P(CPU(NODE),U)
.S FDA($J,8973.201,"?+1,"_IEN_",",.03)=$P(CPU(NODE),U,2)
.S FDA($J,8973.201,"?+1,"_IEN_",",.04)=$P(CPU(NODE),U,3)
.S FDA($J,8973.201,"?+1,"_IEN_",",.05)=$P(CPU(NODE),U,4)
.D UPDATE^DIE("","FDA($J)",.ZIEN,"ERROR")
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPDUTL6 1619 printed Dec 13, 2024@01:41:22 Page 2
KMPDUTL6 ;OIFO/RAK - CPU Utilities ;2/17/04 10:58
+1 ;;3.0;KMPD;;Jan 22, 2009;Build 42
+2 ;;
CPUDEL ;-- delete cpu data from file #8973 - cp parameters
+1 ;
+2 NEW DA,DIK,X,Y
+3 ;
+4 SET DA(1)=$ORDER(^KMPD(8973,0))
if 'DA(1)
QUIT
+5 SET DIK="^KMPD(8973,"_DA(1)_",20,"
+6 FOR DA=0:0
SET DA=$ORDER(^KMPD(8973,DA(1),20,DA))
if 'DA
QUIT
DO ^DIK
+7 ;
+8 QUIT
+9 ;
CPUGET(KMPDARRY) ;--get cpu data
+1 ;-----------------------------------------------------------------------
+2 ; KMPDARRY... Return array (passed by reference) in format:
+3 ; KMPDARRY(1)=Node
+4 ;-----------------------------------------------------------------------
+5 ;
+6 KILL KMPDARRY
+7 if $GET(^KMPD(8973,1,20,0))=""
QUIT
+8 MERGE KMPDARRY=^KMPD(8973,1,20)
+9 ;
+10 QUIT
+11 ;
CPUSET(KMPDLT) ;-- set cpu info into file #8973 cp parameters
+1 ;---------------------------------------------------------------------
+2 ; KMPDLT... Delete previous entries
+3 ; 0 - do not delete
+4 ; 1 - delete
+5 ;---------------------------------------------------------------------
+6 ;
+7 SET KMPDLT=+$GET(KMPDLT)
+8 ;
+9 NEW CPU,IEN,ERROR,FDA,NODE,ZIEN
+10 ;
+11 ; delete current CPU entries
+12 if KMPDLT
DO CPUDEL
+13 ;
+14 SET IEN=$ORDER(^KMPD(8973,0))
if 'IEN
QUIT
+15 ; get cpu data
+16 DO CPU^KMPDUTL5(.CPU)
if '$DATA(CPU)
QUIT
+17 ; file cpu data
+18 SET NODE=""
+19 FOR
SET NODE=$ORDER(CPU(NODE))
if NODE=""
QUIT
Begin DoDot:1
+20 KILL FDA,ERROR,ZIEN
+21 SET FDA($JOB,8973.201,"?+1,"_IEN_",",.01)=NODE
+22 SET FDA($JOB,8973.201,"?+1,"_IEN_",",.02)=$PIECE(CPU(NODE),U)
+23 SET FDA($JOB,8973.201,"?+1,"_IEN_",",.03)=$PIECE(CPU(NODE),U,2)
+24 SET FDA($JOB,8973.201,"?+1,"_IEN_",",.04)=$PIECE(CPU(NODE),U,3)
+25 SET FDA($JOB,8973.201,"?+1,"_IEN_",",.05)=$PIECE(CPU(NODE),U,4)
+26 DO UPDATE^DIE("","FDA($J)",.ZIEN,"ERROR")
End DoDot:1
+27 ;
+28 QUIT