%AUGSE ;MVB; 21-Jan-87 10:45 ;GLOBAL SEARCH EVERY
;
;SEARCH EVERY SPECIFIED NODE AND ITS DATA FOR A GIVEN VALUE
;
START K ^UTILITY($J) D ^%GSEL Q:$O(^UTILITY($J,""))=""
R !,"Search for: ",AUS,! Q:AUS=""
S AUG=""
LOOP F AU=0:0 S AUG=$O(^UTILITY($J,AUG)) Q:AUG="" I $D(@("^"_AUG)) D W !
.S $ZT="ERR",AU="^"_AUG,AUX="" I $L(^UTILITY($J,AUG)) F %=1:1:$L(^(AUG),",")-1 Q:'$L($P(^(AUG),",",%)) S AUX=AUX_$P(^(AUG),",",%)_","
.I $D(@AU),$L(AUX) S AU=AU_"("_AUX
.W !,"Searching "_AU I $D(@($E(AU,1,$L(AU)-(AU[","))_$E(")",(AU[","))))'[0,$ZR[AUS!(@$ZR[AUS) W !?2,$ZR_"="_@$ZR
.I $ZO[AUS!($ZR[AUS) W !?2,$ZR_"="_@$ZR
L1 .F %=0:0 Q:$P($ZR,AU)]"" I $ZO[AUS!($ZR[AUS) W !?2,$ZR_"="_@$ZR
Q
ERR I $ZE["<UNDEF",$ZE["L1^" Q
ZQ
%AUGSE ;MVB; 21-Jan-87 10:45 ;GLOBAL SEARCH EVERY
+1 ;
+2 ;SEARCH EVERY SPECIFIED NODE AND ITS DATA FOR A GIVEN VALUE
+3 ;
START KILL ^UTILITY($JOB)
DO ^%GSEL
IF $ORDER(^UTILITY($JOB,""))=""
QUIT
+1 READ !,"Search for: ",AUS,!
IF AUS=""
QUIT
+2 SET AUG=""
LOOP FOR AU=0:0
SET AUG=$ORDER(^UTILITY($JOB,AUG))
IF AUG=""
QUIT
IF $DATA(@("^"_AUG))
Begin DoDot:1
+1 SET $ZT="ERR"
SET AU="^"_AUG
SET AUX=""
IF $LENGTH(^UTILITY($JOB,AUG))
FOR %=1:1:$LENGTH(^(AUG),",")-1
IF '$LENGTH($PIECE(^(AUG),",",%))
QUIT
SET AUX=AUX_$PIECE(^(AUG),",",%)_","
+2 IF $DATA(@AU)
IF $LENGTH(AUX)
SET AU=AU_"("_AUX
+3 WRITE !,"Searching "_AU
IF $DATA(@($EXTRACT(AU,1,$LENGTH(AU)-(AU[","))_$EXTRACT(")",(AU[","))))'[0
IF $ZR[AUS!(@$ZR[AUS)
WRITE !?2,$ZR_"="_@$ZR
+4 IF $ZO[AUS!($ZR[AUS)
WRITE !?2,$ZR_"="_@$ZR
L1 FOR %=0:0
IF $PIECE($ZR,AU)]""
QUIT
IF $ZO[AUS!($ZR[AUS)
WRITE !?2,$ZR_"="_@$ZR
End DoDot:1
WRITE !
+1 QUIT
ERR IF $ZE["<UNDEF"
IF $ZE["L1^"
QUIT
+1
*** ERROR ***