[613] | 1 | RGUTRRC ;CAIRO/DKM - Remote routine checksum utility;04-Sep-1998 11:26;DKM
|
---|
| 2 | ;;2.1;RUN TIME LIBRARY;;Mar 22, 1999
|
---|
| 3 | ;=================================================================
|
---|
| 4 | ; Performs a routine checksum on selected routines across all CPUs.
|
---|
| 5 | ;=================================================================
|
---|
| 6 | N RGX,RGY,RGRTN,RGCPU,RGUCI,RGCS,RGPID,RGZ,RGZ1,X
|
---|
| 7 | S RGPID=$J
|
---|
| 8 | D HOME^%ZIS
|
---|
| 9 | D TITLE^RGUT("Remote Routine Checksum","1.0")
|
---|
| 10 | RSEL X ^%ZOSF("RSEL")
|
---|
| 11 | W !!
|
---|
| 12 | Q:'$D(^UTILITY(RGPID))
|
---|
| 13 | K %IS,%ZIS
|
---|
| 14 | D ^%ZIS
|
---|
| 15 | G:POP RSEL
|
---|
| 16 | U IO
|
---|
| 17 | S RGUCI=$P($ZU(0),","),RGCPU=$P($ZU(0),",",2),RGRTN=$C(1)
|
---|
| 18 | NXT S RGRTN=$O(^UTILITY(RGPID,RGRTN))
|
---|
| 19 | I RGRTN="" W !! Q
|
---|
| 20 | W RGRTN,"..."
|
---|
| 21 | K RGX,^RGUTL("RRC",RGPID)
|
---|
| 22 | F RGY="CSA","CSB","CSC","PSA","PSB" D:RGY'=RGCPU JOBIT
|
---|
| 23 | S RGCS=$$CHKSUM(RGRTN),RGCNT=0
|
---|
| 24 | W ?15,RGCPU," ",RGCS,!
|
---|
| 25 | AGAIN I '$D(RGX) W ! G NXT
|
---|
| 26 | S RGZ="",RGCNT=RGCNT+1
|
---|
| 27 | I RGCNT>20 D FAIL G NXT
|
---|
| 28 | H:RGCNT>1 1
|
---|
| 29 | NXT2 S RGZ=$O(RGX(RGZ))
|
---|
| 30 | G:RGZ="" AGAIN
|
---|
| 31 | G:'$D(^RGUTL("RRC",RGPID,RGZ)) NXT2
|
---|
| 32 | S RGZ1=^(RGZ)
|
---|
| 33 | K ^(RGZ),RGX(RGZ)
|
---|
| 34 | I RGCS=RGZ1 W ?15,RGZ," same",!
|
---|
| 35 | E W ?15,RGZ," different: ",RGZ1," ************",!
|
---|
| 36 | G NXT2
|
---|
| 37 | FAIL S RGZ=$O(RGX(RGZ))
|
---|
| 38 | Q:RGZ=""
|
---|
| 39 | W ?15,RGZ," failed to report",!
|
---|
| 40 | G FAIL
|
---|
| 41 | JOBIT Q:RGY=RGCPU
|
---|
| 42 | S @$$TRAP^RGZOSF("NOCPU^RGUTRRC")
|
---|
| 43 | J JOB^RGUTRRC(RGPID,RGRTN)[RGUCI,RGY]::1
|
---|
| 44 | I '$ZB W "Failed to start remote job on "_RGUCI_","_RGY,!
|
---|
| 45 | E S RGX(RGY)=""
|
---|
| 46 | NOCPU Q
|
---|
| 47 | JOB(RGJ,RGRTN) ;
|
---|
| 48 | H 1
|
---|
| 49 | S RGCPU=$P($ZU(0),",",2),@$$TRAP^RGZOSF("JERR^RGUTRRC")
|
---|
| 50 | I $$TEST^RGZOSF(RGRTN) S ^RGUTL("RRC",RGJ,RGCPU)=$$CHKSUM(RGRTN)
|
---|
| 51 | E S ^RGUTL("RRC",RGJ,RGCPU)=0
|
---|
| 52 | Q
|
---|
| 53 | JERR S ^RGUTL("RRC",RGJ,RGCPU)=$$EC^%ZOSV
|
---|
| 54 | Q
|
---|
| 55 | CHKSUM(X) ;
|
---|
| 56 | N Y
|
---|
| 57 | X ^%ZOSF("RSUM")
|
---|
| 58 | Q Y
|
---|