AZHLSC23 ; IHS/ADC/GTH:KEU:JN - SAC CHAPTER 2: M LANGUAGE PROGRAMMING STANDARDS & CONVENTIONS ; [ 08/05/1999 7:21 AM ] [4/28/00 1:11pm]
;;5.0;AZHLSC;;JUL 10, 1996
;CHANGED DIF="Z(" TO GLOBAL AND OTHER REFERENCES TO THE
;ARRAY TO THE GLOBAL REFERENCE TO ACCOMMODATE LARGE RTNS SIZES
;IHS/ABQ/KEU 4/7/95
;W !!!,$P($P($T(+1),";",2),"-",2)
NEW A,A3,A4,A5,ARG,B,CH,COM,DIF,G,I,J,LIN,NORTNS,NUL,R,Q,XCNP,Z
D END
S Q="""",A4="=""O ",A5="=""C ",NORTNS=$O(^UTILITY($J,""))=""
S AZHL=""
F S AZHL=$O(^UTILITY($J,AZHL)) Q:AZHL="" W:AZHLTERM "." K Z S X=AZHL,DIF="^TMP($J,""Z"",",XCNP=0 X "X ^%ZOSF(""LOAD""),AZHLGFCX" I S XCNP=XCNP-1 D
.;F Z=3:1:XCNP S Z(Z)=^TMP($J,"Z",Z,0) K ^TMP($J,"Z",Z,0) D
.F Z=3:1:XCNP S Z(Z)=^TMP($J,"Z",Z,0) D
..I Z(Z)["S DUZ" D EN^AZHLSC47 Q:AZHLSC4I=1 S ^TMP($J,"2314",AZHL,Z)=Z(Z)
..;I Z(Z)["S U=" D U^AZHLSC48 I AZHLSC4I'=1 S ^TMP($J,"23151",AZHL,Z)=Z(Z)
..D EN^AZHLSC47 Q:AZHLSC4I=1 F J(1)=" K U"," N U","S U=" I Z(Z)[J(1) S AZHLSC49=J(1),AZHLSCPR=0 D UU51
..D EN^AZHLSC47 Q:AZHLSC4I=1 F J(1)=" K DT"," N DT","S DT=" I Z(Z)[J(1) S AZHLSC49=J(1),AZHLSCPR=0 D DT52
..D EN^AZHLSC47 Q:AZHLSC4I=1 F J(1)="S DTIME="," DTIME=",",DTIME=" I Z(Z)[J(1) S AZHLSC49=J(1),AZHLSCPR=0 D DTI53
..Q
.Q
514 D TTL^AZHLSC("2.3.1.4 SET DUZ(0).")
I NORTNS D NRTN^AZHLSC G 515
I $L($O(^TMP($J,"2314",""))) W !?10,"SUSPECT unconditional SET of DUZ or DUZ array)." S %="" F S %=$O(^TMP($J,"2314",%)) Q:%="" S A=0 F S A=$O(^TMP($J,"2314",%,A)) Q:'A W !?10,"+",A,"^",%," : ",^(A)
515 D TTL^AZHLSC("2.3.1.5.1 SET, KILL or NEW of Variable U.")
I NORTNS D NRTN^AZHLSC G 151
I $L($O(^TMP($J,"23151",""))) W !?10,"SUSPECT unconditional SET of Variable U ." S %="" F S %=$O(^TMP($J,"23151",%)) Q:%="" S A=0 F S A=$O(^TMP($J,"23151",%,A)) Q:'A W !?10,"+",A,"^",%," : ",^(A)
151 D TTL^AZHLSC("2.3.1.5.2 SET, KILL or NEW of Variable DT")
I NORTNS D NRTN^AZHLSC G 153
I $L($O(^TMP($J,"23152",""))) W !?10,"SUSPECT unconditional SET, KILL or NEW of Variable DT ." S %="" F S %=$O(^TMP($J,"23152",%)) Q:%="" S A=0 F S A=$O(^TMP($J,"23152",%,A)) Q:'A W !?10,"+",A,"^",%," : ",^(A)
;
153 D TTL^AZHLSC("2.3.1.5.3 SET DTIME.")
I NORTNS D NRTN^AZHLSC G 524
I $L($O(^TMP($J,"23153",""))) W !?10,"SUSPECT unconditional SET of DTIME." S %="" F S %=$O(^TMP($J,"23153",%)) Q:%="" S A=0 F S A=$O(^TMP($J,"23153",%,A)) Q:'A W !?10,"+",A,"^",%," : ",^(A)
524 D 524^AZHLSC51
5251 D ^AZHLSC52
526 D ^AZHLSC53
529 D ^AZHLSC51
Q
AZHLSC52 ; SET RECORD TO PRINT
S AZHLSCTI=$F(Z(Z),J(1)) I $E(Z(Z),AZHLSCTI,AZHLSCTI+2)="IME" S (AZHLSC4I,AZHLSCPR)=1
I AZHLSCPR=1 Q
S AZHLSCPR=1 S ^TMP($J,"23152",AZHL,Z)=Z(Z) Q
AZHLSC53 ; SET RECORD TO PRINT AZHLSC4I AZHLSCPR = 1 DO NOT PRINT
I AZHLSCPR=1 Q
S AZHLSCPR=1 S ^TMP($J,"23153",AZHL,Z)=Z(Z) Q
U51 ; SET RECORD TO PRINT AZHLSC4I AZHLSCPR = 1 DO NOT PRINT
I AZHLSCPR=1 Q
S AZHLSCPR=1 S ^TMP($J,"23151",AZHL,Z)=Z(Z) Q
UU51 ;THIS SUB ROUTINE WILL LOOK AT AZHLSC4I ONE TIME
D U^AZHLSC48 I AZHLSC4I=1 G UUEND
D U51
S AZHL0=AZHL D EN^AZHLSC47 I AZHLSC4I=1 G UUEND
D U51
D EN^AZHLSC46 I AZHLSC4I=1 G UUEND
D U51 Q
UUEND Q
DT52 ;THIS SUB ROUTINE WILL LOOK AT AZHLSC4I ONE TIME
D DTXLFDT^AZHLSC48 I AZHLSC4I=1 G DTEND
D AZHLSC52 I AZHLSC4I=1 G DTEND
S AZHL0=AZHL D EN^AZHLSC47 I AZHLSC4I=1 G DTEND
D AZHLSC52
D EN^AZHLSC46 I AZHLSC4I=1 G DTEND
D AZHLSC52 Q
DTEND Q
DTI53 ;THIS SUB ROUTINE WILL LOOK AT AZHLSC4I ONE TIME
D DTIMEXU^AZHLSC48 I AZHLSC4I=1 G DTIEND
D AZHLSC53 G DTIEND
S AZHL0=AZHL D EN^AZHLSC47 I AZHLSC4I=1 G DTIEND
D AZHLSC53
D EN^AZHLSC46 I AZHLSC4I=1 G DTEND
D AZHLSC53 Q
DTIEND Q
END K ^TMP($J,"2314"),^("Z"),Z
Q
AZHLSC23 ; IHS/ADC/GTH:KEU:JN - SAC CHAPTER 2: M LANGUAGE PROGRAMMING STANDARDS & CONVENTIONS ; [ 08/05/1999 7:21 AM ] [4/28/00 1:11pm]
+1 ;;5.0;AZHLSC;;JUL 10, 1996
+2 ;CHANGED DIF="Z(" TO GLOBAL AND OTHER REFERENCES TO THE
+3 ;ARRAY TO THE GLOBAL REFERENCE TO ACCOMMODATE LARGE RTNS SIZES
+4 ;IHS/ABQ/KEU 4/7/95
+5 ;W !!!,$P($P($T(+1),";",2),"-",2)
+6 NEW A,A3,A4,A5,ARG,B,CH,COM,DIF,G,I,J,LIN,NORTNS,NUL,R,Q,XCNP,Z
+7 DO END
+8 SET Q=""""
SET A4="=""O "
SET A5="=""C "
SET NORTNS=$ORDER(^UTILITY($JOB,""))=""
+9 SET AZHL=""
+10 FOR
SET AZHL=$ORDER(^UTILITY($JOB,AZHL))
IF AZHL=""
QUIT
IF AZHLTERM
WRITE "."
KILL Z
SET X=AZHL
SET DIF="^TMP($J,""Z"","
SET XCNP=0
XECUTE "X ^%ZOSF(""LOAD""),AZHLGFCX"
IF $TEST
SET XCNP=XCNP-1
Begin DoDot:1
+11 ;F Z=3:1:XCNP S Z(Z)=^TMP($J,"Z",Z,0) K ^TMP($J,"Z",Z,0) D
+12 FOR Z=3:1:XCNP
SET Z(Z)=^TMP($JOB,"Z",Z,0)
Begin DoDot:2
+13 IF Z(Z)["S DUZ"
DO EN^AZHLSC47
IF AZHLSC4I=1
QUIT
SET ^TMP($JOB,"2314",AZHL,Z)=Z(Z)
+14 ;I Z(Z)["S U=" D U^AZHLSC48 I AZHLSC4I'=1 S ^TMP($J,"23151",AZHL,Z)=Z(Z)
+15 DO EN^AZHLSC47
IF AZHLSC4I=1
QUIT
FOR J(1)=" K U"," N U","S U="
IF Z(Z)[J(1)
SET AZHLSC49=J(1)
SET AZHLSCPR=0
DO UU51
+16 DO EN^AZHLSC47
IF AZHLSC4I=1
QUIT
FOR J(1)=" K DT"," N DT","S DT="
IF Z(Z)[J(1)
SET AZHLSC49=J(1)
SET AZHLSCPR=0
DO DT52
+17 DO EN^AZHLSC47
IF AZHLSC4I=1
QUIT
FOR J(1)="S DTIME="," DTIME=",",DTIME="
IF Z(Z)[J(1)
SET AZHLSC49=J(1)
SET AZHLSCPR=0
DO DTI53
+18 QUIT
End DoDot:2
+19 QUIT
End DoDot:1
514 DO TTL^AZHLSC("2.3.1.4 SET DUZ(0).")
+1 IF NORTNS
DO NRTN^AZHLSC
GOTO 515
+2 IF $LENGTH($ORDER(^TMP($JOB,"2314","")))
WRITE !?10,"SUSPECT unconditional SET of DUZ or DUZ array)."
SET %=""
FOR
SET %=$ORDER(^TMP($JOB,"2314",%))
IF %=""
QUIT
SET A=0
FOR
SET A=$ORDER(^TMP($JOB,"2314",%,A))
IF 'A
QUIT
WRITE !?10,"+",A,"^",%," : ",^(A)
515 DO TTL^AZHLSC("2.3.1.5.1 SET, KILL or NEW of Variable U.")
+1 IF NORTNS
DO NRTN^AZHLSC
GOTO 151
+2 IF $LENGTH($ORDER(^TMP($JOB,"23151","")))
WRITE !?10,"SUSPECT unconditional SET of Variable U ."
SET %=""
FOR
SET %=$ORDER(^TMP($JOB,"23151",%))
IF %=""
QUIT
SET A=0
FOR
SET A=$ORDER(^TMP($JOB,"23151",%,A))
IF 'A
QUIT
WRITE !?10,"+",A,"^",%," : ",^(A)
151 DO TTL^AZHLSC("2.3.1.5.2 SET, KILL or NEW of Variable DT")
+1 IF NORTNS
DO NRTN^AZHLSC
GOTO 153
+2 IF $LENGTH($ORDER(^TMP($JOB,"23152","")))
WRITE !?10,"SUSPECT unconditional SET, KILL or NEW of Variable DT ."
SET %=""
FOR
SET %=$ORDER(^TMP($JOB,"23152",%))
IF %=""
QUIT
SET A=0
FOR
SET A=$ORDER(^TMP($JOB,"23152",%,A))
IF 'A
QUIT
WRITE !?10,"+",A,"^",%," : ",^(A)
+3 ;
153 DO TTL^AZHLSC("2.3.1.5.3 SET DTIME.")
+1 IF NORTNS
DO NRTN^AZHLSC
GOTO 524
+2 IF $LENGTH($ORDER(^TMP($JOB,"23153","")))
WRITE !?10,"SUSPECT unconditional SET of DTIME."
SET %=""
FOR
SET %=$ORDER(^TMP($JOB,"23153",%))
IF %=""
QUIT
SET A=0
FOR
SET A=$ORDER(^TMP($JOB,"23153",%,A))
IF 'A
QUIT
WRITE !?10,"+",A,"^",%," : ",^(A)
524 DO 524^AZHLSC51
5251 DO ^AZHLSC52
526 DO ^AZHLSC53
529 DO ^AZHLSC51
+1 QUIT
AZHLSC52 ; SET RECORD TO PRINT
+1 SET AZHLSCTI=$FIND(Z(Z),J(1))
IF $EXTRACT(Z(Z),AZHLSCTI,AZHLSCTI+2)="IME"
SET (AZHLSC4I,AZHLSCPR)=1
+2 IF AZHLSCPR=1
QUIT
+3 SET AZHLSCPR=1
SET ^TMP($JOB,"23152",AZHL,Z)=Z(Z)
QUIT
AZHLSC53 ; SET RECORD TO PRINT AZHLSC4I AZHLSCPR = 1 DO NOT PRINT
+1 IF AZHLSCPR=1
QUIT
+2 SET AZHLSCPR=1
SET ^TMP($JOB,"23153",AZHL,Z)=Z(Z)
QUIT
U51 ; SET RECORD TO PRINT AZHLSC4I AZHLSCPR = 1 DO NOT PRINT
+1 IF AZHLSCPR=1
QUIT
+2 SET AZHLSCPR=1
SET ^TMP($JOB,"23151",AZHL,Z)=Z(Z)
QUIT
UU51 ;THIS SUB ROUTINE WILL LOOK AT AZHLSC4I ONE TIME
+1 DO U^AZHLSC48
IF AZHLSC4I=1
GOTO UUEND
+2 DO U51
+3 SET AZHL0=AZHL
DO EN^AZHLSC47
IF AZHLSC4I=1
GOTO UUEND
+4 DO U51
+5 DO EN^AZHLSC46
IF AZHLSC4I=1
GOTO UUEND
+6 DO U51
QUIT
UUEND QUIT
DT52 ;THIS SUB ROUTINE WILL LOOK AT AZHLSC4I ONE TIME
+1 DO DTXLFDT^AZHLSC48
IF AZHLSC4I=1
GOTO DTEND
+2 DO AZHLSC52
IF AZHLSC4I=1
GOTO DTEND
+3 SET AZHL0=AZHL
DO EN^AZHLSC47
IF AZHLSC4I=1
GOTO DTEND
+4 DO AZHLSC52
+5 DO EN^AZHLSC46
IF AZHLSC4I=1
GOTO DTEND
+6 DO AZHLSC52
QUIT
DTEND QUIT
DTI53 ;THIS SUB ROUTINE WILL LOOK AT AZHLSC4I ONE TIME
+1 DO DTIMEXU^AZHLSC48
IF AZHLSC4I=1
GOTO DTIEND
+2 DO AZHLSC53
GOTO DTIEND
+3 SET AZHL0=AZHL
DO EN^AZHLSC47
IF AZHLSC4I=1
GOTO DTIEND
+4 DO AZHLSC53
+5 DO EN^AZHLSC46
IF AZHLSC4I=1
GOTO DTEND
+6 DO AZHLSC53
QUIT
DTIEND QUIT
END KILL ^TMP($JOB,"2314"),^("Z"),Z
+1 QUIT