AZHLSC52 ; IHS/ADC/GTH:KEU:JN - SAC CHAPTER 2: M LANGUAGE PROGRAMMING & CONVENTIONS ; [ 04/16/1999 1:15 PM ]
;;5.0;AZHLSC;;JUL 10, 1996
;
;IHS/ABQ/KEU - CHANGED DIF="Z(" TO ^TMP($J,"Z" AND OTHER
;REFERENCES TO THE ARRAY TO THE GLOBAL.
NEW A,AC,ARG,AZHL0,AZHLA,AZHLB,CH,COM,DIF,EC,ERR,ERTX,GK,L,LAB,LABO,LI,LL,LOC,LV,NORTNS,OP,PL,Q,RDTIME,RTN,S,S1,STR,V,XCNP,Z
D END
S NORTNS=$O(^UTILITY($J,""))="" G:NORTNS 5251
S AZHL0="",(LAB,LABO)="",RTN="AZHL"
F K Z,^TMP($J,"Z") S AZHL0=$O(^UTILITY($J,AZHL0)) Q:AZHL0="" S X=AZHL0,DIF="^TMP($J,""Z"",",XCNP=0 X "X ^%ZOSF(""LOAD""),AZHLGFCX" I D
.F AZHLB=3:1 Q:'$D(^TMP($J,"Z",AZHLB)) D
..S Z=^TMP($J,"Z",AZHLB,0)
..I Z["S ^UTILITY(" D EN^AZHLSC46 Q:AZHLSC4I=1 S ^TMP($J,"2.3.2.5",AZHL0,AZHLB)=Z
..I Z["S ^TMP(" D CHKTMP I AZHLSC4I'=1 D EN^AZHLSC46 I AZHLSC4I'=1 S ^TMP($J,"2.3.2.5.1",AZHL0,AZHLB)=Z
..I Z["^XTMP(" D CHKXTMP I AZHLSC4I'=1 D EN^AZHLSC46 Q:AZHLSC4I=1 S ^TMP($J,"2.3.2.5.2",AZHL0,AZHLB)=Z
.Q
5251 D TTL^AZHLSC("2.3.2.5), Use of ^UTILITY")
I NORTNS D NRTN^AZHLSC G 52512
I $L($O(^TMP($J,"2.3.2.5",""))) W !?10,"Possible SET of ^UTILITY( global." S %="" F S %=$O(^TMP($J,"2.3.2.5",%)) Q:%="" S A=0 F S A=$O(^TMP($J,"2.3.2.5",%,A)) Q:'A W !?10,"+",A,"^",%," : ",^(A)
52512 D TTL^AZHLSC("2.3.2.5.1), Should be ^TMP($J or ^TMP(NAMESPACE,$J")
I NORTNS D NRTN^AZHLSC G 52513
I $L($O(^TMP($J,"2.3.2.5.1",""))) W !?10,"Improper use of ^TMP( global." S %="" F S %=$O(^TMP($J,"2.3.2.5.1",%)) Q:%="" S A=0 F S A=$O(^TMP($J,"2.3.2.5.1",%,A)) Q:'A W !?10,"+",A,"^",%," : ",^(A)
52513 D TTL^AZHLSC("2.3.2.5.2), Should be ^XTMP(NAMESPACE")
I NORTNS D NRTN^AZHLSC G X
I $L($O(^TMP($J,"2.3.2.5.2",""))) W !?10,"Improper use of ^XTMP( global." S %="" F S %=$O(^TMP($J,"2.3.2.5.2",%)) Q:%="" S A=0 F S A=$O(^TMP($J,"2.3.2.5.2",%,A)) Q:'A W !?10,"+",A,"^",%," : ",^(A)
X Q
;
END K ^TMP($J,"2.3.2.5"),^TMP($J,"2.3.2.5.1"),^TMP($J,"2.3.2.5.2"),^("Z")
;K ^TMP($J,"Z")
Q
CHKTMP ; ^TMP($J, OR ^TMP(NAMESPACE,$J
S AZHLSCF="",AZHLSC4I="",AZHLSCG=""
S AZHLSCF=$F(Z,"^TMP(") Q:AZHLSCF=0
I $E(Z,AZHLSCF,AZHLSCF+1)="$J" S AZHLSC4I=1 Q
Q:$D(AZHLNMSP)="" S AZHLSCG=$E(Z,AZHLSCF,AZHLSCF+40) I $P(AZHLSCG,",",2)["$J",($P(AZHLSCG,",",1)[AZHLNMSP) S AZHLSC4I=1 Q
S AZHLSC4I=0 Q
CHKXTMP ; ^XTMP(NAMESPACE
Q:$D(AZHLNMSP)=""
S AZHLSCF="",AZHLSC4I="",AZHLSCG=""
S AZHLSCF=$F(Z,"^XTMP(") Q:AZHLSCF=0
I $E(Z,AZHLSCF,AZHLSCF+4)[AZHLNMSP S AZHLSC4I=1 Q
S AZHLSC4I=0 Q
AZHLSC52 ; IHS/ADC/GTH:KEU:JN - SAC CHAPTER 2: M LANGUAGE PROGRAMMING & CONVENTIONS ; [ 04/16/1999 1:15 PM ]
+1 ;;5.0;AZHLSC;;JUL 10, 1996
+2 ;
+3 ;IHS/ABQ/KEU - CHANGED DIF="Z(" TO ^TMP($J,"Z" AND OTHER
+4 ;REFERENCES TO THE ARRAY TO THE GLOBAL.
+5 NEW A,AC,ARG,AZHL0,AZHLA,AZHLB,CH,COM,DIF,EC,ERR,ERTX,GK,L,LAB,LABO,LI,LL,LOC,LV,NORTNS,OP,PL,Q,RDTIME,RTN,S,S1,STR,V,XCNP,Z
+6 DO END
+7 SET NORTNS=$ORDER(^UTILITY($JOB,""))=""
IF NORTNS
GOTO 5251
+8 SET AZHL0=""
SET (LAB,LABO)=""
SET RTN="AZHL"
+9 FOR
KILL Z,^TMP($JOB,"Z")
SET AZHL0=$ORDER(^UTILITY($JOB,AZHL0))
IF AZHL0=""
QUIT
SET X=AZHL0
SET DIF="^TMP($J,""Z"","
SET XCNP=0
XECUTE "X ^%ZOSF(""LOAD""),AZHLGFCX"
IF $TEST
Begin DoDot:1
+10 FOR AZHLB=3:1
IF '$DATA(^TMP($JOB,"Z",AZHLB))
QUIT
Begin DoDot:2
+11 SET Z=^TMP($JOB,"Z",AZHLB,0)
+12 IF Z["S ^UTILITY("
DO EN^AZHLSC46
IF AZHLSC4I=1
QUIT
SET ^TMP($JOB,"2.3.2.5",AZHL0,AZHLB)=Z
+13 IF Z["S ^TMP("
DO CHKTMP
IF AZHLSC4I'=1
DO EN^AZHLSC46
IF AZHLSC4I'=1
SET ^TMP($JOB,"2.3.2.5.1",AZHL0,AZHLB)=Z
+14 IF Z["^XTMP("
DO CHKXTMP
IF AZHLSC4I'=1
DO EN^AZHLSC46
IF AZHLSC4I=1
QUIT
SET ^TMP($JOB,"2.3.2.5.2",AZHL0,AZHLB)=Z
End DoDot:2
+15 QUIT
End DoDot:1
5251 DO TTL^AZHLSC("2.3.2.5), Use of ^UTILITY")
+1 IF NORTNS
DO NRTN^AZHLSC
GOTO 52512
+2 IF $LENGTH($ORDER(^TMP($JOB,"2.3.2.5","")))
WRITE !?10,"Possible SET of ^UTILITY( global."
SET %=""
FOR
SET %=$ORDER(^TMP($JOB,"2.3.2.5",%))
IF %=""
QUIT
SET A=0
FOR
SET A=$ORDER(^TMP($JOB,"2.3.2.5",%,A))
IF 'A
QUIT
WRITE !?10,"+",A,"^",%," : ",^(A)
52512 DO TTL^AZHLSC("2.3.2.5.1), Should be ^TMP($J or ^TMP(NAMESPACE,$J")
+1 IF NORTNS
DO NRTN^AZHLSC
GOTO 52513
+2 IF $LENGTH($ORDER(^TMP($JOB,"2.3.2.5.1","")))
WRITE !?10,"Improper use of ^TMP( global."
SET %=""
FOR
SET %=$ORDER(^TMP($JOB,"2.3.2.5.1",%))
IF %=""
QUIT
SET A=0
FOR
SET A=$ORDER(^TMP($JOB,"2.3.2.5.1",%,A))
IF 'A
QUIT
WRITE !?10,"+",A,"^",%," : ",^(A)
52513 DO TTL^AZHLSC("2.3.2.5.2), Should be ^XTMP(NAMESPACE")
+1 IF NORTNS
DO NRTN^AZHLSC
GOTO X
+2 IF $LENGTH($ORDER(^TMP($JOB,"2.3.2.5.2","")))
WRITE !?10,"Improper use of ^XTMP( global."
SET %=""
FOR
SET %=$ORDER(^TMP($JOB,"2.3.2.5.2",%))
IF %=""
QUIT
SET A=0
FOR
SET A=$ORDER(^TMP($JOB,"2.3.2.5.2",%,A))
IF 'A
QUIT
WRITE !?10,"+",A,"^",%," : ",^(A)
X QUIT
+1 ;
END KILL ^TMP($JOB,"2.3.2.5"),^TMP($JOB,"2.3.2.5.1"),^TMP($JOB,"2.3.2.5.2"),^("Z")
+1 ;K ^TMP($J,"Z")
+2 QUIT
CHKTMP ; ^TMP($J, OR ^TMP(NAMESPACE,$J
+1 SET AZHLSCF=""
SET AZHLSC4I=""
SET AZHLSCG=""
+2 SET AZHLSCF=$FIND(Z,"^TMP(")
IF AZHLSCF=0
QUIT
+3 IF $EXTRACT(Z,AZHLSCF,AZHLSCF+1)="$J"
SET AZHLSC4I=1
QUIT
+4 IF $DATA(AZHLNMSP)=""
QUIT
SET AZHLSCG=$EXTRACT(Z,AZHLSCF,AZHLSCF+40)
IF $PIECE(AZHLSCG,",",2)["$J"
IF ($PIECE(AZHLSCG,",",1)[AZHLNMSP)
SET AZHLSC4I=1
QUIT
+5 SET AZHLSC4I=0
QUIT
CHKXTMP ; ^XTMP(NAMESPACE
+1 IF $DATA(AZHLNMSP)=""
QUIT
+2 SET AZHLSCF=""
SET AZHLSC4I=""
SET AZHLSCG=""
+3 SET AZHLSCF=$FIND(Z,"^XTMP(")
IF AZHLSCF=0
QUIT
+4 IF $EXTRACT(Z,AZHLSCF,AZHLSCF+4)[AZHLNMSP
SET AZHLSC4I=1
QUIT
+5 SET AZHLSC4I=0
QUIT