ENY2VAC1 ;(WIRMFO)/DH-National Roll-up of Y2K ;11.5.98
;;7.0;ENGINEERING;**55,59**;August 17,1993
ROLLCUM ; roll-up cumulative information
N J,K,CLASS,DONE
S STATION="" F S STATION=$O(COUNT(STATION)) Q:STATION="" D
. F J="FS","MED","PC","TEL" S KOUNT=KOUNT+1,ENC(KOUNT,0)="C1^"_J_U_COUNT(STATION,J,"ACT")_U_COUNT(STATION,J,"Y2K")_"^|"
. S KOUNT=KOUNT+1,ENC(KOUNT,0)="C1^UNCLASS^"_COUNT(STATION,0,"ACT")_U_COUNT(STATION,0,"Y2K")_"^|"
. F J="FS","MED","PC","TEL" I COUNT(STATION,J,"Y2K") D
.. S KOUNT=KOUNT+1,ENC(KOUNT,0)="C2^"_J_U_COUNT(STATION,J,"FC")_U_COUNT(STATION,J,"NC")_U_COUNT(STATION,J,"CC")_U_COUNT(STATION,J,"NA")_U_COUNT(STATION,J,0)_"^|"
. I COUNT(STATION,0,"Y2K") S KOUNT=KOUNT+1,ENC(KOUNT,0)="C2^UNCLASS^"_COUNT(STATION,0,"FC")_U_COUNT(STATION,0,"NC")_U_COUNT(STATION,0,"CC")_U_COUNT(STATION,0,"NA")_U_COUNT(STATION,0,0)_"^|"
. F J="FS","MED","PC","TEL" S KOUNT=KOUNT+1 D
.. I 'COUNT(STATION,J,"FC") S ENC(KOUNT,0)="C3^"_J_"^^^^^^|" Q
.. S ENC(KOUNT,0)="C3^"_J_U_COUNT(STATION,J,"FC")_U_(COUNT(STATION,J,"FC")-COUNT(STATION,J,"FC","UPG"))_U_COUNT(STATION,J,"FC","UPG")_U_$P(^TMP($J,STATION,J,"FC","ACST")+.5,".")_U_$P(^TMP($J,STATION,J,"FC","ECST")+.5,".")_"^|"
. S KOUNT=KOUNT+1 I 'COUNT(STATION,0,"FC") S ENC(KOUNT,0)="C3^UNCLASS^^^^^^|"
. E S ENC(KOUNT,0)="C3^UNCLASS^"_COUNT(STATION,0,"FC")_U_(COUNT(STATION,0,"FC")-COUNT(STATION,0,"FC","UPG"))_U_COUNT(STATION,0,"FC","UPG")_U_$P(^TMP($J,STATION,0,"FC","ACST")+.5,".")_U_$P(^TMP($J,STATION,0,"FC","ECST")+.5,".")_"^|"
. F J="FS","MED","PC","TEL" S KOUNT=KOUNT+1 D
.. I 'COUNT(STATION,J,"NC") S ENC(KOUNT,0)="C4^"_J_"^^^^^^^^^|" Q
.. S ENC(KOUNT,0)="C4^"_J_U_COUNT(STATION,J,"NC")_U_COUNT(STATION,J,"NC","RET")_U_COUNT(STATION,J,"NC","REP")_U_COUNT(STATION,J,"NC","USE")_U_COUNT(STATION,J,"NC",0)_U_COUNT(STATION,J,"NC","ATD")
.. S ENC(KOUNT,0)=ENC(KOUNT,0)_U_$P(^TMP($J,STATION,J,"NC","ETOT")+.5,".")_U_($P(^TMP($J,STATION,J,"NC","ETOT")+.5,".")-$P(^TMP($J,STATION,J,"NC","ETD")+.5,"."))_"^|"
. S KOUNT=KOUNT+1 I 'COUNT(STATION,0,"NC") S ENC(KOUNT,0)="C4^UNCLASS^^^^^^^^^|"
. E D
.. S ENC(KOUNT,0)="C4^UNCLASS^"_COUNT(STATION,0,"NC")_U_COUNT(STATION,0,"NC","RET")_U_COUNT(STATION,0,"NC","REP")_U_COUNT(STATION,0,"NC","USE")_U_COUNT(STATION,0,"NC",0)_U_COUNT(STATION,0,"NC","ATD")
.. S ENC(KOUNT,0)=ENC(KOUNT,0)_U_$P(^TMP($J,STATION,0,"NC","ETOT")+.5,".")_U_($P(^TMP($J,STATION,0,"NC","ETOT")+.5,".")-$P(^TMP($J,STATION,0,"NC","ETD")+.5,"."))_"^|"
. F J="FS","MED","PC","TEL" S KOUNT=KOUNT+1 S ENC(KOUNT,0)="C5^"_J_U_COUNT(STATION,J,"CC")_U_$P(^TMP($J,STATION,J,"CC","ECST")+.5,".")_"^|"
. S KOUNT=KOUNT+1,ENC(KOUNT,0)="C5^UNCLASS^"_COUNT(STATION,0,"CC")_U_$P(^TMP($J,STATION,0,"CC","ECST")+.5,".")_"^|"
. F J="FS","MED","PC","TEL" D
.. S KOUNT=KOUNT+1,ENC(KOUNT,0)="C6^"_J F K=1:1:12 S ENC(KOUNT,0)=ENC(KOUNT,0)_U_COUNT(STATION,J,"CC","UPG",1998,K)_U_$P(^TMP($J,STATION,J,"CC","ECST",1998,K)+.5,".")
.. S ENC(KOUNT,0)=ENC(KOUNT,0)_"^|"
. S KOUNT=KOUNT+1,ENC(KOUNT,0)="C6^UNCLASS" F K=1:1:12 S ENC(KOUNT,0)=ENC(KOUNT,0)_U_COUNT(STATION,0,"CC","UPG",1998,K)_U_$P(^TMP($J,STATION,0,"CC","ECST",1998,K)+.5,".")
. S ENC(KOUNT,0)=ENC(KOUNT,0)_"^|"
. F J="FS","MED","PC","TEL" D
.. S KOUNT=KOUNT+1,ENC(KOUNT,0)="C7^"_J F K=1:1:12 S ENC(KOUNT,0)=ENC(KOUNT,0)_U_COUNT(STATION,J,"CC","UPG",1999,K)_U_$P(^TMP($J,STATION,J,"CC","ECST",1999,K)+.5,".")
.. S ENC(KOUNT,0)=ENC(KOUNT,0)_"^|"
. S KOUNT=KOUNT+1,ENC(KOUNT,0)="C7^UNCLASS" F K=1:1:12 S ENC(KOUNT,0)=ENC(KOUNT,0)_U_COUNT(STATION,0,"CC","UPG",1999,K)_U_$P(^TMP($J,STATION,0,"CC","ECST",1999,K)+.5,".")
. S ENC(KOUNT,0)=ENC(KOUNT,0)_"^|"
. F J="FS","MED","PC","TEL" D
.. S KOUNT=KOUNT+1,ENC(KOUNT,0)="C8^"_J F K=1:1:12 S ENC(KOUNT,0)=ENC(KOUNT,0)_U_COUNT(STATION,J,"CC","UPG",2000,K)_U_$P(^TMP($J,STATION,J,"CC","ECST",2000,K)+.5,".")
.. S ENC(KOUNT,0)=ENC(KOUNT,0)_"^|"
. S KOUNT=KOUNT+1,ENC(KOUNT,0)="C8^UNCLASS" F K=1:1:12 S ENC(KOUNT,0)=ENC(KOUNT,0)_U_COUNT(STATION,0,"CC","UPG",2000,K)_U_$P(^TMP($J,STATION,0,"CC","ECST",2000,K)+.5,".")
. S ENC(KOUNT,0)=ENC(KOUNT,0)_"^|"
. F CLASS="FS","MED","PC","TEL" S KOUNT=KOUNT+1,DONE=0 D
.. F K=2000,1999,1998 Q:DONE F J=12:-1:0 S DONE=$G(COUNT(STATION,CLASS,"NC","SCHDT",K,J)) Q:DONE
.. I 'DONE S ENC(KOUNT,0)="C9^"_CLASS_"^^|" Q
.. S:J=0 J=12 S:$L(J)=1 J="0"_J S DATE=(K-1699)_J_"00",DATE=$$EOM^ENUTL(DATE),ENC(KOUNT,0)="C9^"_CLASS_U_(DATE+17000000)_"^|"
. S KOUNT=KOUNT+1,DONE=0 F K=2000,1999,1998 Q:DONE F J=12:-1:0 S DONE=$G(COUNT(STATION,0,"NC","SCHDT",K,J)) Q:DONE
. I 'DONE S ENC(KOUNT,0)="C9^UNCLASS^^|" Q
. S:J=0 J=12 S:$L(J)=1 J="0"_J S DATE=(K-1699)_J_"00",DATE=$$EOM^ENUTL(DATE),ENC(KOUNT,0)="C9^UNCLASS^"_(DATE+17000000)_"^|"
Q
;ENY2VAC1
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENY2VAC1 4712 printed Dec 13, 2024@01:57:39 Page 2
ENY2VAC1 ;(WIRMFO)/DH-National Roll-up of Y2K ;11.5.98
+1 ;;7.0;ENGINEERING;**55,59**;August 17,1993
ROLLCUM ; roll-up cumulative information
+1 NEW J,K,CLASS,DONE
+2 SET STATION=""
FOR
SET STATION=$ORDER(COUNT(STATION))
if STATION=""
QUIT
Begin DoDot:1
+3 FOR J="FS","MED","PC","TEL"
SET KOUNT=KOUNT+1
SET ENC(KOUNT,0)="C1^"_J_U_COUNT(STATION,J,"ACT")_U_COUNT(STATION,J,"Y2K")_"^|"
+4 SET KOUNT=KOUNT+1
SET ENC(KOUNT,0)="C1^UNCLASS^"_COUNT(STATION,0,"ACT")_U_COUNT(STATION,0,"Y2K")_"^|"
+5 FOR J="FS","MED","PC","TEL"
IF COUNT(STATION,J,"Y2K")
Begin DoDot:2
+6 SET KOUNT=KOUNT+1
SET ENC(KOUNT,0)="C2^"_J_U_COUNT(STATION,J,"FC")_U_COUNT(STATION,J,"NC")_U_COUNT(STATION,J,"CC")_U_COUNT(STATION,J,"NA")_U_COUNT(STATION,J,0)_"^|"
End DoDot:2
+7 IF COUNT(STATION,0,"Y2K")
SET KOUNT=KOUNT+1
SET ENC(KOUNT,0)="C2^UNCLASS^"_COUNT(STATION,0,"FC")_U_COUNT(STATION,0,"NC")_U_COUNT(STATION,0,"CC")_U_COUNT(STATION,0,"NA")_U_COUNT(STATION,0,0)_"^|"
+8 FOR J="FS","MED","PC","TEL"
SET KOUNT=KOUNT+1
Begin DoDot:2
+9 IF 'COUNT(STATION,J,"FC")
SET ENC(KOUNT,0)="C3^"_J_"^^^^^^|"
QUIT
+10 SET ENC(KOUNT,0)="C3^"_J_U_COUNT(STATION,J,"FC")_U_(COUNT(STATION,J,"FC")-COUNT(STATION,J,"FC","UPG"))_U_COUNT(STATION,J,"FC","UPG")_U_$PIECE(^TMP($JOB,STATION,J,"FC","ACST")+.5,".")_U_$PIECE(^TMP($JOB,STATION,J,"FC","ECST")+.5,
".")_"^|"
End DoDot:2
+11 SET KOUNT=KOUNT+1
IF 'COUNT(STATION,0,"FC")
SET ENC(KOUNT,0)="C3^UNCLASS^^^^^^|"
+12 IF '$TEST
SET ENC(KOUNT,0)="C3^UNCLASS^"_COUNT(STATION,0,"FC")_U_(COUNT(STATION,0,"FC")-COUNT(STATION,0,"FC","UPG"))_U_COUNT(STATION,0,"FC","UPG")_U_$PIECE(^TMP($JOB,STATION,0,"FC","ACST")+.5,".")_U_$PIECE(^TMP($JOB,STATION,0,"FC","ECST")+.5,
".")_"^|"
+13 FOR J="FS","MED","PC","TEL"
SET KOUNT=KOUNT+1
Begin DoDot:2
+14 IF 'COUNT(STATION,J,"NC")
SET ENC(KOUNT,0)="C4^"_J_"^^^^^^^^^|"
QUIT
+15 SET ENC(KOUNT,0)="C4^"_J_U_COUNT(STATION,J,"NC")_U_COUNT(STATION,J,"NC","RET")_U_COUNT(STATION,J,"NC","REP")_U_COUNT(STATION,J,"NC","USE")_U_COUNT(STATION,J,"NC",0)_U_COUNT(STATION,J,"NC","ATD")
+16 SET ENC(KOUNT,0)=ENC(KOUNT,0)_U_$PIECE(^TMP($JOB,STATION,J,"NC","ETOT")+.5,".")_U_($PIECE(^TMP($JOB,STATION,J,"NC","ETOT")+.5,".")-$PIECE(^TMP($JOB,STATION,J,"NC","ETD")+.5,"."))_"^|"
End DoDot:2
+17 SET KOUNT=KOUNT+1
IF 'COUNT(STATION,0,"NC")
SET ENC(KOUNT,0)="C4^UNCLASS^^^^^^^^^|"
+18 IF '$TEST
Begin DoDot:2
+19 SET ENC(KOUNT,0)="C4^UNCLASS^"_COUNT(STATION,0,"NC")_U_COUNT(STATION,0,"NC","RET")_U_COUNT(STATION,0,"NC","REP")_U_COUNT(STATION,0,"NC","USE")_U_COUNT(STATION,0,"NC",0)_U_COUNT(STATION,0,"NC","ATD")
+20 SET ENC(KOUNT,0)=ENC(KOUNT,0)_U_$PIECE(^TMP($JOB,STATION,0,"NC","ETOT")+.5,".")_U_($PIECE(^TMP($JOB,STATION,0,"NC","ETOT")+.5,".")-$PIECE(^TMP($JOB,STATION,0,"NC","ETD")+.5,"."))_"^|"
End DoDot:2
+21 FOR J="FS","MED","PC","TEL"
SET KOUNT=KOUNT+1
SET ENC(KOUNT,0)="C5^"_J_U_COUNT(STATION,J,"CC")_U_$PIECE(^TMP($JOB,STATION,J,"CC","ECST")+.5,".")_"^|"
+22 SET KOUNT=KOUNT+1
SET ENC(KOUNT,0)="C5^UNCLASS^"_COUNT(STATION,0,"CC")_U_$PIECE(^TMP($JOB,STATION,0,"CC","ECST")+.5,".")_"^|"
+23 FOR J="FS","MED","PC","TEL"
Begin DoDot:2
+24 SET KOUNT=KOUNT+1
SET ENC(KOUNT,0)="C6^"_J
FOR K=1:1:12
SET ENC(KOUNT,0)=ENC(KOUNT,0)_U_COUNT(STATION,J,"CC","UPG",1998,K)_U_$PIECE(^TMP($JOB,STATION,J,"CC","ECST",1998,K)+.5,".")
+25 SET ENC(KOUNT,0)=ENC(KOUNT,0)_"^|"
End DoDot:2
+26 SET KOUNT=KOUNT+1
SET ENC(KOUNT,0)="C6^UNCLASS"
FOR K=1:1:12
SET ENC(KOUNT,0)=ENC(KOUNT,0)_U_COUNT(STATION,0,"CC","UPG",1998,K)_U_$PIECE(^TMP($JOB,STATION,0,"CC","ECST",1998,K)+.5,".")
+27 SET ENC(KOUNT,0)=ENC(KOUNT,0)_"^|"
+28 FOR J="FS","MED","PC","TEL"
Begin DoDot:2
+29 SET KOUNT=KOUNT+1
SET ENC(KOUNT,0)="C7^"_J
FOR K=1:1:12
SET ENC(KOUNT,0)=ENC(KOUNT,0)_U_COUNT(STATION,J,"CC","UPG",1999,K)_U_$PIECE(^TMP($JOB,STATION,J,"CC","ECST",1999,K)+.5,".")
+30 SET ENC(KOUNT,0)=ENC(KOUNT,0)_"^|"
End DoDot:2
+31 SET KOUNT=KOUNT+1
SET ENC(KOUNT,0)="C7^UNCLASS"
FOR K=1:1:12
SET ENC(KOUNT,0)=ENC(KOUNT,0)_U_COUNT(STATION,0,"CC","UPG",1999,K)_U_$PIECE(^TMP($JOB,STATION,0,"CC","ECST",1999,K)+.5,".")
+32 SET ENC(KOUNT,0)=ENC(KOUNT,0)_"^|"
+33 FOR J="FS","MED","PC","TEL"
Begin DoDot:2
+34 SET KOUNT=KOUNT+1
SET ENC(KOUNT,0)="C8^"_J
FOR K=1:1:12
SET ENC(KOUNT,0)=ENC(KOUNT,0)_U_COUNT(STATION,J,"CC","UPG",2000,K)_U_$PIECE(^TMP($JOB,STATION,J,"CC","ECST",2000,K)+.5,".")
+35 SET ENC(KOUNT,0)=ENC(KOUNT,0)_"^|"
End DoDot:2
+36 SET KOUNT=KOUNT+1
SET ENC(KOUNT,0)="C8^UNCLASS"
FOR K=1:1:12
SET ENC(KOUNT,0)=ENC(KOUNT,0)_U_COUNT(STATION,0,"CC","UPG",2000,K)_U_$PIECE(^TMP($JOB,STATION,0,"CC","ECST",2000,K)+.5,".")
+37 SET ENC(KOUNT,0)=ENC(KOUNT,0)_"^|"
+38 FOR CLASS="FS","MED","PC","TEL"
SET KOUNT=KOUNT+1
SET DONE=0
Begin DoDot:2
+39 FOR K=2000,1999,1998
if DONE
QUIT
FOR J=12:-1:0
SET DONE=$GET(COUNT(STATION,CLASS,"NC","SCHDT",K,J))
if DONE
QUIT
+40 IF 'DONE
SET ENC(KOUNT,0)="C9^"_CLASS_"^^|"
QUIT
+41 if J=0
SET J=12
if $LENGTH(J)=1
SET J="0"_J
SET DATE=(K-1699)_J_"00"
SET DATE=$$EOM^ENUTL(DATE)
SET ENC(KOUNT,0)="C9^"_CLASS_U_(DATE+17000000)_"^|"
End DoDot:2
+42 SET KOUNT=KOUNT+1
SET DONE=0
FOR K=2000,1999,1998
if DONE
QUIT
FOR J=12:-1:0
SET DONE=$GET(COUNT(STATION,0,"NC","SCHDT",K,J))
if DONE
QUIT
+43 IF 'DONE
SET ENC(KOUNT,0)="C9^UNCLASS^^|"
QUIT
+44 if J=0
SET J=12
if $LENGTH(J)=1
SET J="0"_J
SET DATE=(K-1699)_J_"00"
SET DATE=$$EOM^ENUTL(DATE)
SET ENC(KOUNT,0)="C9^UNCLASS^"_(DATE+17000000)_"^|"
End DoDot:1
+45 QUIT
+46 ;ENY2VAC1