RGUTRRC ;CAIRO/DKM - Remote routine checksum utility;04-Sep-1998 11:26;DKM
;;2.1;RUN TIME LIBRARY;;Mar 22, 1999
;=================================================================
; Performs a routine checksum on selected routines across all CPUs.
;=================================================================
N RGX,RGY,RGRTN,RGCPU,RGUCI,RGCS,RGPID,RGZ,RGZ1,X
S RGPID=$J
D HOME^%ZIS
D TITLE^RGUT("Remote Routine Checksum","1.0")
RSEL X ^%ZOSF("RSEL")
W !!
Q:'$D(^UTILITY(RGPID))
K %IS,%ZIS
D ^%ZIS
G:POP RSEL
U IO
S RGUCI=$P($ZU(0),","),RGCPU=$P($ZU(0),",",2),RGRTN=$C(1)
NXT S RGRTN=$O(^UTILITY(RGPID,RGRTN))
I RGRTN="" W !! Q
W RGRTN,"..."
K RGX,^RGUTL("RRC",RGPID)
F RGY="CSA","CSB","CSC","PSA","PSB" D:RGY'=RGCPU JOBIT
S RGCS=$$CHKSUM(RGRTN),RGCNT=0
W ?15,RGCPU," ",RGCS,!
AGAIN I '$D(RGX) W ! G NXT
S RGZ="",RGCNT=RGCNT+1
I RGCNT>20 D FAIL G NXT
H:RGCNT>1 1
NXT2 S RGZ=$O(RGX(RGZ))
G:RGZ="" AGAIN
G:'$D(^RGUTL("RRC",RGPID,RGZ)) NXT2
S RGZ1=^(RGZ)
K ^(RGZ),RGX(RGZ)
I RGCS=RGZ1 W ?15,RGZ," same",!
E W ?15,RGZ," different: ",RGZ1," ************",!
G NXT2
FAIL S RGZ=$O(RGX(RGZ))
Q:RGZ=""
W ?15,RGZ," failed to report",!
G FAIL
JOBIT Q:RGY=RGCPU
S @$$TRAP^RGZOSF("NOCPU^RGUTRRC")
J JOB^RGUTRRC(RGPID,RGRTN)[RGUCI,RGY]::1
I '$ZB W "Failed to start remote job on "_RGUCI_","_RGY,!
E S RGX(RGY)=""
NOCPU Q
JOB(RGJ,RGRTN) ;
H 1
S RGCPU=$P($ZU(0),",",2),@$$TRAP^RGZOSF("JERR^RGUTRRC")
I $$TEST^RGZOSF(RGRTN) S ^RGUTL("RRC",RGJ,RGCPU)=$$CHKSUM(RGRTN)
E S ^RGUTL("RRC",RGJ,RGCPU)=0
Q
JERR S ^RGUTL("RRC",RGJ,RGCPU)=$$EC^%ZOSV
Q
CHKSUM(X) ;
N Y
X ^%ZOSF("RSUM")
Q Y
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRGUTRRC 1674 printed Dec 13, 2024@02:37:27 Page 2
RGUTRRC ;CAIRO/DKM - Remote routine checksum utility;04-Sep-1998 11:26;DKM
+1 ;;2.1;RUN TIME LIBRARY;;Mar 22, 1999
+2 ;=================================================================
+3 ; Performs a routine checksum on selected routines across all CPUs.
+4 ;=================================================================
+5 NEW RGX,RGY,RGRTN,RGCPU,RGUCI,RGCS,RGPID,RGZ,RGZ1,X
+6 SET RGPID=$JOB
+7 DO HOME^%ZIS
+8 DO TITLE^RGUT("Remote Routine Checksum","1.0")
RSEL XECUTE ^%ZOSF("RSEL")
+1 WRITE !!
+2 if '$DATA(^UTILITY(RGPID))
QUIT
+3 KILL %IS,%ZIS
+4 DO ^%ZIS
+5 if POP
GOTO RSEL
+6 USE IO
+7 SET RGUCI=$PIECE($ZU(0),",")
SET RGCPU=$PIECE($ZU(0),",",2)
SET RGRTN=$CHAR(1)
NXT SET RGRTN=$ORDER(^UTILITY(RGPID,RGRTN))
+1 IF RGRTN=""
WRITE !!
QUIT
+2 WRITE RGRTN,"..."
+3 KILL RGX,^RGUTL("RRC",RGPID)
+4 FOR RGY="CSA","CSB","CSC","PSA","PSB"
if RGY'=RGCPU
DO JOBIT
+5 SET RGCS=$$CHKSUM(RGRTN)
SET RGCNT=0
+6 WRITE ?15,RGCPU," ",RGCS,!
AGAIN IF '$DATA(RGX)
WRITE !
GOTO NXT
+1 SET RGZ=""
SET RGCNT=RGCNT+1
+2 IF RGCNT>20
DO FAIL
GOTO NXT
+3 if RGCNT>1
HANG 1
NXT2 SET RGZ=$ORDER(RGX(RGZ))
+1 if RGZ=""
GOTO AGAIN
+2 if '$DATA(^RGUTL("RRC",RGPID,RGZ))
GOTO NXT2
+3 SET RGZ1=^(RGZ)
+4 KILL ^(RGZ),RGX(RGZ)
+5 IF RGCS=RGZ1
WRITE ?15,RGZ," same",!
+6 IF '$TEST
WRITE ?15,RGZ," different: ",RGZ1," ************",!
+7 GOTO NXT2
FAIL SET RGZ=$ORDER(RGX(RGZ))
+1 if RGZ=""
QUIT
+2 WRITE ?15,RGZ," failed to report",!
+3 GOTO FAIL
JOBIT if RGY=RGCPU
QUIT
+1 SET @$$TRAP^RGZOSF("NOCPU^RGUTRRC")
+2 JOB JOB^RGUTRRC(RGPID,RGRTN)[RGUCI,RGY]::1
+3 IF '$ZB
WRITE "Failed to start remote job on "_RGUCI_","_RGY,!
+4 IF '$TEST
SET RGX(RGY)=""
NOCPU QUIT
JOB(RGJ,RGRTN) ;
+1 HANG 1
+2 SET RGCPU=$PIECE($ZU(0),",",2)
SET @$$TRAP^RGZOSF("JERR^RGUTRRC")
+3 IF $$TEST^RGZOSF(RGRTN)
SET ^RGUTL("RRC",RGJ,RGCPU)=$$CHKSUM(RGRTN)
+4 IF '$TEST
SET ^RGUTL("RRC",RGJ,RGCPU)=0
+5 QUIT
JERR SET ^RGUTL("RRC",RGJ,RGCPU)=$$EC^%ZOSV
+1 QUIT
CHKSUM(X) ;
+1 NEW Y
+2 XECUTE ^%ZOSF("RSUM")
+3 QUIT Y