ENEQPMS2 ;(WASH ISC)/DH-Select Equipment for PMI ;07/18/2024
;;7.0;ENGINEERING;**26,35,42,106**;Aug 17, 1993;Build 4
NTRY ; Identify entries for specified PM worklist (single shop)
; List is sorted in ^TMP($J,
K ^TMP($J) N DA,I,SE,NODE
F DA=0:0 S DA=$O(^ENG(6914,"AB",ENSHKEY,DA)) Q:DA'>0 S SE=0 F S SE=$O(^ENG(6914,"AB",ENSHKEY,DA,SE)) Q:SE'>0 D LST2
D PR^ENEQPMS5 G OUT
;
MNTRY ; Identify entries for specified PM worklist (all shops)
; List is sorted in ^TMP($J,
K ^TMP($J) N I,SE,NODE
F ENSHKEY=0:0 S ENSHKEY=$O(^ENG(6914,"AB",ENSHKEY)) Q:ENSHKEY'>0 F DA=0:0 S DA=$O(^ENG(6914,"AB",ENSHKEY,DA)) Q:DA'>0 S SE=0 F S SE=$O(^ENG(6914,"AB",ENSHKEY,DA,SE)) Q:SE'>0 D LST2
D PR^ENEQPMS5 G OUT
;
LST2 N EN,A,B,C,X,X1,X2,TAG,SUB,MULT
N ENHZ ;EN*7.0*106
S X1=$P($G(^ENG(6914,DA,3)),U) I "^4^5^"[(U_X1_U) Q
I 'ENSRT("OOS"),X1=2 Q
Q:'$D(^ENG(6914,DA,4,SE,0)) I '$D(ENCRIT("ALL")) D Q:ENCRIT<0
. S ENCRIT=$P(^ENG(6914,DA,4,SE,0),U,4) I ENCRIT'?1.2N S:'$G(ENCRIT("NULL")) ENCRIT=-1 Q
. I ENCRIT<ENCRIT("FR")!(ENCRIT>ENCRIT("TO")) S ENCRIT=-1
S EN("NEXT")="A" F X="A","B","C" S @X=""
S X1=0,X2=$P(^ENG(6914,DA,4,SE,0),U,2) I 'ENTECH("ALL"),X2'=ENTECH Q
I ENTECH'=0 S:X2="" X2=0 S:$D(^ENG("EMP",X2,0)) X1=""""_$P(^(0),U)_"""" D
. I X2>0,X1=0 S X1=""""_"DELETED"_""""
. S @EN("NEXT")=X1
. S EN("NEXT")=$C($A(EN("NEXT"))+1)
S TAG="LST"_ENSRT D @TAG Q:$G(X)=-1
S SUB="" F X1="A","B","C" Q:$G(@X1)="" S SUB=SUB_@X1_","
D LSTSKP
Q
;
LSTE ; By ENTRY NUMBER
I ENSRT("ALL") Q
I ENSRT("FR")]DA!(DA]ENSRT("TO")) S X=-1
Q
LSTP ; By PM NUMBER
S X1=$P($G(^ENG(6914,DA,3)),U,6) S:X1="" X1=0
S:X1'=0 X1=""""_X1_""""
S @EN("NEXT")=X1
Q
LSTI ; By LOCAL ID
N J ;EN*7.0*106
S (X1,X1("T"))=$P($G(^ENG(6914,DA,3)),U,7) S:X1="" (X1,X1("T"))=0
S:X1'?.N X1("T")=""""_X1_""""
I ENSRT("ALL") S @EN("NEXT")=X1("T"),EN("NEXT")=$C($A(EN("NEXT"))+1)
E S X="" D
. I ENSRT("FR")]X1!(X1]ENSRT("TO")) S X=-1 Q
. S @EN("NEXT")=X1("T"),EN("NEXT")=$C($A(EN("NEXT"))+1)
I ENSRT("LOC"),$G(X)'=-1 D
. S X1=$$LOC^ENEQPMS8(DA) I X1=-1 S X=-1 Q
. I $P(X1,U)=-2,ENSRT("LOC","ALL") D
.. S X1=""""_$P(X1,U,2)_""""
.. F J=1:1:($L(ENSRT("BY"))-1) S X1="0,"_X1
. I $P(X1,U)=-2 S X=-1 Q
. I X1=-3,ENSRT("LOC","ALL") D
.. S X1=0 F J=1:1:($L(ENSRT("BY"))-1) S X1="0,"_X1
. I X1=-3 S X=-1 Q
. S @EN("NEXT")=X1
Q
LSTL ; By LOCATION
S X1=$$LOC^ENEQPMS8(DA) I X1=-1 S X=-1 Q
I $P(X1,U)=-2,ENSRT("LOC","ALL") D
. S X1=""""_$P(X1,U,2)_""""
. F J=1:1:($L(ENSRT("BY"))-1) S X1="0,"_X1
I $P(X1,U)=-2 S X=-1 Q
I X1=-3,ENSRT("LOC","ALL") D
. S X1=0 F J=1:1:($L(ENSRT("BY"))-1) S X1="0,"_X1
I X1=-3 S X=-1 Q
S @EN("NEXT")=X1
Q
LSTC ; By EQUIPMENT CATEGORY
S X2=$P($G(^ENG(6914,DA,1)),U) S:X2="" X1=0
I X2>0 S X1=$P($G(^ENG(6911,X2,0)),U) S:X1="" X1=0
S:X1'?.N X1=""""_X1_""""
I 'ENSRT("ALL"),X2'=ENSRT("FR") S X=-1 Q
S @EN("NEXT")=X1,EN("NEXT")=$C($A(EN("NEXT"))+1)
I ENSRT("LOC") D
. S X1=$$LOC^ENEQPMS8(DA) I X1=-1 S X=-1 Q
. I $P(X1,U)=-2,ENSRT("LOC","ALL") D
.. S X1=""""_$P(X1,U,2)_""""
.. F J=1:1:($L(ENSRT("BY"))-1) S X1="0,"_X1
. I $P(X1,U)=-2 S X=-1 Q
. I X1=-3,ENSRT("LOC","ALL") D
.. S X1=0 F J=1:1:($L(ENSRT("BY"))-1) S X1="0,"_X1
. I X1=-3 S X=-1 Q
. S @EN("NEXT")=X1
Q
LSTS ; By OWNING SERVICE
S X2=$P($G(^ENG(6914,DA,3)),U,2) S:X2="" X1=0
I X2>0 S X1=$P($G(^DIC(49,X2,0)),U) S:X1="" X1=0
S:X1'?.N X1=""""_X1_""""
I 'ENSRT("ALL"),X2'=ENSRT("FR") S X=-1 Q
S @EN("NEXT")=X1,EN("NEXT")=$C($A(EN("NEXT"))+1)
I ENSRT("LOC") D
. S X1=$$LOC^ENEQPMS8(DA) I X1=-1 S X=-1 Q
. I $P(X1,U)=-2,ENSRT("LOC","ALL") D
.. S X1=""""_$P(X1,U,2)_""""
.. F J=1:1:($L(ENSRT("BY"))-1) S X1="0,"_X1
. I $P(X1,U)=-2 S X=-1 Q
. I X1=-3,ENSRT("LOC","ALL") D
.. S X1=0 F J=1:1:($L(ENSRT("BY"))-1) S X1="0,"_X1
. I X1=-3 S X=-1 Q
. S @EN("NEXT")=X1
Q
;
LSTSKP ; Check for SKIP MONTHS
S ENSKP=$P(^ENG(6914,DA,4,SE,0),U,3) G:ENSKP']"" LST21 S ENMNTH=$P(ENSKP,"-",1) D RVMNTH^ENLIB1 S ENSKP("FR")=ENMN,ENMNTH=$P(ENSKP,"-",2) D RVMNTH^ENLIB1 S ENSKP("TO")=ENMN
I ENSKP("FR")'>ENSKP("TO") G:ENPMMN<ENSKP("FR")!(ENPMMN>ENSKP("TO")) LST21 K ENSKP Q
I ENPMMN'>ENSKP("TO")!(ENPMMN'<ENSKP("FR")) K ENSKP Q
LST21 ; SKIP MONTH not a problem
K ENSKP S ENHZS="^",ENSTMN=1 I $D(^ENG(6914,DA,4,SE,1)),^(1)>1 S ENSTMN=^(1)
S MULT=0 F S MULT=$O(^ENG(6914,DA,4,SE,2,MULT)) Q:MULT'>0 I $P(^ENG(6914,DA,4,SE,2,MULT,0),U)]"" S ENHZS=ENHZS_$P(^(0),U)_"^",ENHZ($P(^(0),U))=SE_U_MULT
I ENPM["W" D LSTW Q
I ENHZS["^TA^" D Q:$G(ENHZ)="TA"
. S MULT=$P(ENHZ("TA"),U,2),ENSTYR=$P(^ENG(6914,DA,4,SE,2,MULT,0),U,6) Q:ENSTYR'?4N
. I ENSTYR>ENPMYR Q
. I '(ENPMYR-ENSTYR#3),(ENPMMN=ENSTMN) S ENHZ="TA",ENHZ(1)="TRI-ANNUAL" D BLD
I ENHZS["^BA^" D Q:$G(ENHZ)="BA"
. S MULT=$P(ENHZ("BA"),U,2),ENSTYR=$P(^ENG(6914,DA,4,SE,2,MULT,0),U,6) Q:ENSTYR'?4N
. I ENSTYR>ENPMYR Q
. I '(ENPMYR-ENSTYR#2),(ENPMMN=ENSTMN) S ENHZ="BA",ENHZ(1)="BI-ANNUAL" D BLD
I ENHZS["^A^",ENSTMN=ENPMMN S ENHZ="A",ENHZ(1)="ANNUAL" D BLD Q
I ENHZS["^S^",'(ENPMMN-ENSTMN#6) S ENHZ="S",ENHZ(1)="SEMI-ANNUAL" D BLD Q
I ENHZS["^Q^",'(ENPMMN-ENSTMN#3) S ENHZ="Q",ENHZ(1)="QUARTERLY" D BLD Q
I ENHZS["^BM^",'(ENPMMN-ENSTMN#2) S ENHZ="BM",ENHZ(1)="BI-MONTHLY" D BLD Q
I ENHZS["^M^" S ENHZ="M",ENHZ(1)="MONTHLY" D BLD
Q
;
LSTW I ENHZS["BW",(ENPM["1"!(ENPM["3")) S ENHZ="BW",ENHZ(1)="BI-WEEKLY" D BLD Q
I ENHZS["^W^" S ENHZ="W",ENHZ(1)="WEEKLY" D BLD
Q
;
BLD ; Build ^TMP GLOBAL
S NODE="^TMP($J,""ENWL"","_ENSHKEY_","_SUB_DA_")"
S @NODE=ENHZ_U_ENHZ(1)_U_ENHZ(ENHZ)
Q
;
OUT K K,S,ENDATE,ENPM,ENPMDT,ENA,ENHZS,ENPMWK,ENSHOP,ENSHKEY,ENPMMN,ENSTMN,ENSTYR,ENCRIT,ENSRT,ENTECH,ENY,ENERR,ENMN,ENMNTH,ENI,ENLID
S:$D(ZTQUEUED) ZTREQ="@"
Q
;ENEQPMS2
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENEQPMS2 5769 printed Dec 13, 2024@01:52:54 Page 2
ENEQPMS2 ;(WASH ISC)/DH-Select Equipment for PMI ;07/18/2024
+1 ;;7.0;ENGINEERING;**26,35,42,106**;Aug 17, 1993;Build 4
NTRY ; Identify entries for specified PM worklist (single shop)
+1 ; List is sorted in ^TMP($J,
+2 KILL ^TMP($JOB)
NEW DA,I,SE,NODE
+3 FOR DA=0:0
SET DA=$ORDER(^ENG(6914,"AB",ENSHKEY,DA))
if DA'>0
QUIT
SET SE=0
FOR
SET SE=$ORDER(^ENG(6914,"AB",ENSHKEY,DA,SE))
if SE'>0
QUIT
DO LST2
+4 DO PR^ENEQPMS5
GOTO OUT
+5 ;
MNTRY ; Identify entries for specified PM worklist (all shops)
+1 ; List is sorted in ^TMP($J,
+2 KILL ^TMP($JOB)
NEW I,SE,NODE
+3 FOR ENSHKEY=0:0
SET ENSHKEY=$ORDER(^ENG(6914,"AB",ENSHKEY))
if ENSHKEY'>0
QUIT
FOR DA=0:0
SET DA=$ORDER(^ENG(6914,"AB",ENSHKEY,DA))
if DA'>0
QUIT
SET SE=0
FOR
SET SE=$ORDER(^ENG(6914,"AB",ENSHKEY,DA,SE))
if SE'>0
QUIT
DO LST2
+4 DO PR^ENEQPMS5
GOTO OUT
+5 ;
LST2 NEW EN,A,B,C,X,X1,X2,TAG,SUB,MULT
+1 ;EN*7.0*106
NEW ENHZ
+2 SET X1=$PIECE($GET(^ENG(6914,DA,3)),U)
IF "^4^5^"[(U_X1_U)
QUIT
+3 IF 'ENSRT("OOS")
IF X1=2
QUIT
+4 if '$DATA(^ENG(6914,DA,4,SE,0))
QUIT
IF '$DATA(ENCRIT("ALL"))
Begin DoDot:1
+5 SET ENCRIT=$PIECE(^ENG(6914,DA,4,SE,0),U,4)
IF ENCRIT'?1.2N
if '$GET(ENCRIT("NULL"))
SET ENCRIT=-1
QUIT
+6 IF ENCRIT<ENCRIT("FR")!(ENCRIT>ENCRIT("TO"))
SET ENCRIT=-1
End DoDot:1
if ENCRIT<0
QUIT
+7 SET EN("NEXT")="A"
FOR X="A","B","C"
SET @X=""
+8 SET X1=0
SET X2=$PIECE(^ENG(6914,DA,4,SE,0),U,2)
IF 'ENTECH("ALL")
IF X2'=ENTECH
QUIT
+9 IF ENTECH'=0
if X2=""
SET X2=0
if $DATA(^ENG("EMP",X2,0))
SET X1=""""_$PIECE(^(0),U)_""""
Begin DoDot:1
+10 IF X2>0
IF X1=0
SET X1=""""_"DELETED"_""""
+11 SET @EN("NEXT")=X1
+12 SET EN("NEXT")=$CHAR($ASCII(EN("NEXT"))+1)
End DoDot:1
+13 SET TAG="LST"_ENSRT
DO @TAG
if $GET(X)=-1
QUIT
+14 SET SUB=""
FOR X1="A","B","C"
if $GET(@X1)=""
QUIT
SET SUB=SUB_@X1_","
+15 DO LSTSKP
+16 QUIT
+17 ;
LSTE ; By ENTRY NUMBER
+1 IF ENSRT("ALL")
QUIT
+2 IF ENSRT("FR")]DA!(DA]ENSRT("TO"))
SET X=-1
+3 QUIT
LSTP ; By PM NUMBER
+1 SET X1=$PIECE($GET(^ENG(6914,DA,3)),U,6)
if X1=""
SET X1=0
+2 if X1'=0
SET X1=""""_X1_""""
+3 SET @EN("NEXT")=X1
+4 QUIT
LSTI ; By LOCAL ID
+1 ;EN*7.0*106
NEW J
+2 SET (X1,X1("T"))=$PIECE($GET(^ENG(6914,DA,3)),U,7)
if X1=""
SET (X1,X1("T"))=0
+3 if X1'?.N
SET X1("T")=""""_X1_""""
+4 IF ENSRT("ALL")
SET @EN("NEXT")=X1("T")
SET EN("NEXT")=$CHAR($ASCII(EN("NEXT"))+1)
+5 IF '$TEST
SET X=""
Begin DoDot:1
+6 IF ENSRT("FR")]X1!(X1]ENSRT("TO"))
SET X=-1
QUIT
+7 SET @EN("NEXT")=X1("T")
SET EN("NEXT")=$CHAR($ASCII(EN("NEXT"))+1)
End DoDot:1
+8 IF ENSRT("LOC")
IF $GET(X)'=-1
Begin DoDot:1
+9 SET X1=$$LOC^ENEQPMS8(DA)
IF X1=-1
SET X=-1
QUIT
+10 IF $PIECE(X1,U)=-2
IF ENSRT("LOC","ALL")
Begin DoDot:2
+11 SET X1=""""_$PIECE(X1,U,2)_""""
+12 FOR J=1:1:($LENGTH(ENSRT("BY"))-1)
SET X1="0,"_X1
End DoDot:2
+13 IF $PIECE(X1,U)=-2
SET X=-1
QUIT
+14 IF X1=-3
IF ENSRT("LOC","ALL")
Begin DoDot:2
+15 SET X1=0
FOR J=1:1:($LENGTH(ENSRT("BY"))-1)
SET X1="0,"_X1
End DoDot:2
+16 IF X1=-3
SET X=-1
QUIT
+17 SET @EN("NEXT")=X1
End DoDot:1
+18 QUIT
LSTL ; By LOCATION
+1 SET X1=$$LOC^ENEQPMS8(DA)
IF X1=-1
SET X=-1
QUIT
+2 IF $PIECE(X1,U)=-2
IF ENSRT("LOC","ALL")
Begin DoDot:1
+3 SET X1=""""_$PIECE(X1,U,2)_""""
+4 FOR J=1:1:($LENGTH(ENSRT("BY"))-1)
SET X1="0,"_X1
End DoDot:1
+5 IF $PIECE(X1,U)=-2
SET X=-1
QUIT
+6 IF X1=-3
IF ENSRT("LOC","ALL")
Begin DoDot:1
+7 SET X1=0
FOR J=1:1:($LENGTH(ENSRT("BY"))-1)
SET X1="0,"_X1
End DoDot:1
+8 IF X1=-3
SET X=-1
QUIT
+9 SET @EN("NEXT")=X1
+10 QUIT
LSTC ; By EQUIPMENT CATEGORY
+1 SET X2=$PIECE($GET(^ENG(6914,DA,1)),U)
if X2=""
SET X1=0
+2 IF X2>0
SET X1=$PIECE($GET(^ENG(6911,X2,0)),U)
if X1=""
SET X1=0
+3 if X1'?.N
SET X1=""""_X1_""""
+4 IF 'ENSRT("ALL")
IF X2'=ENSRT("FR")
SET X=-1
QUIT
+5 SET @EN("NEXT")=X1
SET EN("NEXT")=$CHAR($ASCII(EN("NEXT"))+1)
+6 IF ENSRT("LOC")
Begin DoDot:1
+7 SET X1=$$LOC^ENEQPMS8(DA)
IF X1=-1
SET X=-1
QUIT
+8 IF $PIECE(X1,U)=-2
IF ENSRT("LOC","ALL")
Begin DoDot:2
+9 SET X1=""""_$PIECE(X1,U,2)_""""
+10 FOR J=1:1:($LENGTH(ENSRT("BY"))-1)
SET X1="0,"_X1
End DoDot:2
+11 IF $PIECE(X1,U)=-2
SET X=-1
QUIT
+12 IF X1=-3
IF ENSRT("LOC","ALL")
Begin DoDot:2
+13 SET X1=0
FOR J=1:1:($LENGTH(ENSRT("BY"))-1)
SET X1="0,"_X1
End DoDot:2
+14 IF X1=-3
SET X=-1
QUIT
+15 SET @EN("NEXT")=X1
End DoDot:1
+16 QUIT
LSTS ; By OWNING SERVICE
+1 SET X2=$PIECE($GET(^ENG(6914,DA,3)),U,2)
if X2=""
SET X1=0
+2 IF X2>0
SET X1=$PIECE($GET(^DIC(49,X2,0)),U)
if X1=""
SET X1=0
+3 if X1'?.N
SET X1=""""_X1_""""
+4 IF 'ENSRT("ALL")
IF X2'=ENSRT("FR")
SET X=-1
QUIT
+5 SET @EN("NEXT")=X1
SET EN("NEXT")=$CHAR($ASCII(EN("NEXT"))+1)
+6 IF ENSRT("LOC")
Begin DoDot:1
+7 SET X1=$$LOC^ENEQPMS8(DA)
IF X1=-1
SET X=-1
QUIT
+8 IF $PIECE(X1,U)=-2
IF ENSRT("LOC","ALL")
Begin DoDot:2
+9 SET X1=""""_$PIECE(X1,U,2)_""""
+10 FOR J=1:1:($LENGTH(ENSRT("BY"))-1)
SET X1="0,"_X1
End DoDot:2
+11 IF $PIECE(X1,U)=-2
SET X=-1
QUIT
+12 IF X1=-3
IF ENSRT("LOC","ALL")
Begin DoDot:2
+13 SET X1=0
FOR J=1:1:($LENGTH(ENSRT("BY"))-1)
SET X1="0,"_X1
End DoDot:2
+14 IF X1=-3
SET X=-1
QUIT
+15 SET @EN("NEXT")=X1
End DoDot:1
+16 QUIT
+17 ;
LSTSKP ; Check for SKIP MONTHS
+1 SET ENSKP=$PIECE(^ENG(6914,DA,4,SE,0),U,3)
if ENSKP']""
GOTO LST21
SET ENMNTH=$PIECE(ENSKP,"-",1)
DO RVMNTH^ENLIB1
SET ENSKP("FR")=ENMN
SET ENMNTH=$PIECE(ENSKP,"-",2)
DO RVMNTH^ENLIB1
SET ENSKP("TO")=ENMN
+2 IF ENSKP("FR")'>ENSKP("TO")
if ENPMMN<ENSKP("FR")!(ENPMMN>ENSKP("TO"))
GOTO LST21
KILL ENSKP
QUIT
+3 IF ENPMMN'>ENSKP("TO")!(ENPMMN'<ENSKP("FR"))
KILL ENSKP
QUIT
LST21 ; SKIP MONTH not a problem
+1 KILL ENSKP
SET ENHZS="^"
SET ENSTMN=1
IF $DATA(^ENG(6914,DA,4,SE,1))
IF ^(1)>1
SET ENSTMN=^(1)
+2 SET MULT=0
FOR
SET MULT=$ORDER(^ENG(6914,DA,4,SE,2,MULT))
if MULT'>0
QUIT
IF $PIECE(^ENG(6914,DA,4,SE,2,MULT,0),U)]""
SET ENHZS=ENHZS_$PIECE(^(0),U)_"^"
SET ENHZ($PIECE(^(0),U))=SE_U_MULT
+3 IF ENPM["W"
DO LSTW
QUIT
+4 IF ENHZS["^TA^"
Begin DoDot:1
+5 SET MULT=$PIECE(ENHZ("TA"),U,2)
SET ENSTYR=$PIECE(^ENG(6914,DA,4,SE,2,MULT,0),U,6)
if ENSTYR'?4N
QUIT
+6 IF ENSTYR>ENPMYR
QUIT
+7 IF '(ENPMYR-ENSTYR#3)
IF (ENPMMN=ENSTMN)
SET ENHZ="TA"
SET ENHZ(1)="TRI-ANNUAL"
DO BLD
End DoDot:1
if $GET(ENHZ)="TA"
QUIT
+8 IF ENHZS["^BA^"
Begin DoDot:1
+9 SET MULT=$PIECE(ENHZ("BA"),U,2)
SET ENSTYR=$PIECE(^ENG(6914,DA,4,SE,2,MULT,0),U,6)
if ENSTYR'?4N
QUIT
+10 IF ENSTYR>ENPMYR
QUIT
+11 IF '(ENPMYR-ENSTYR#2)
IF (ENPMMN=ENSTMN)
SET ENHZ="BA"
SET ENHZ(1)="BI-ANNUAL"
DO BLD
End DoDot:1
if $GET(ENHZ)="BA"
QUIT
+12 IF ENHZS["^A^"
IF ENSTMN=ENPMMN
SET ENHZ="A"
SET ENHZ(1)="ANNUAL"
DO BLD
QUIT
+13 IF ENHZS["^S^"
IF '(ENPMMN-ENSTMN#6)
SET ENHZ="S"
SET ENHZ(1)="SEMI-ANNUAL"
DO BLD
QUIT
+14 IF ENHZS["^Q^"
IF '(ENPMMN-ENSTMN#3)
SET ENHZ="Q"
SET ENHZ(1)="QUARTERLY"
DO BLD
QUIT
+15 IF ENHZS["^BM^"
IF '(ENPMMN-ENSTMN#2)
SET ENHZ="BM"
SET ENHZ(1)="BI-MONTHLY"
DO BLD
QUIT
+16 IF ENHZS["^M^"
SET ENHZ="M"
SET ENHZ(1)="MONTHLY"
DO BLD
+17 QUIT
+18 ;
LSTW IF ENHZS["BW"
IF (ENPM["1"!(ENPM["3"))
SET ENHZ="BW"
SET ENHZ(1)="BI-WEEKLY"
DO BLD
QUIT
+1 IF ENHZS["^W^"
SET ENHZ="W"
SET ENHZ(1)="WEEKLY"
DO BLD
+2 QUIT
+3 ;
BLD ; Build ^TMP GLOBAL
+1 SET NODE="^TMP($J,""ENWL"","_ENSHKEY_","_SUB_DA_")"
+2 SET @NODE=ENHZ_U_ENHZ(1)_U_ENHZ(ENHZ)
+3 QUIT
+4 ;
OUT KILL K,S,ENDATE,ENPM,ENPMDT,ENA,ENHZS,ENPMWK,ENSHOP,ENSHKEY,ENPMMN,ENSTMN,ENSTYR,ENCRIT,ENSRT,ENTECH,ENY,ENERR,ENMN,ENMNTH,ENI,ENLID
+1 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+2 QUIT
+3 ;ENEQPMS2