ENY2REP ;;(WIRMFO)/DH-Y2K Activity Report ;8.27.98
;;7.0;ENGINEERING;**51,55**;August 17, 1993
ACT ; periodic activity report
; counts and totals of all entries and changes within a user specified
; date range
N %DT
I $P($G(^DIC(6910,1,0)),U,2)']"" W !!,"There is no STATION NUMBER in your Engineering Init Parameters file.",!,"Can't proceed.",*7 Q
ACT1 S %DT="AEP",%DT("A")="Enter starting date: ",%DT(0)=-DT
S Y=$E(DT,1,5)-1 S:$E(Y,4,5)="00" Y=($E(Y,1,3)-1)_12 S Y=Y_"01"
X ^DD("DD") S %DT("B")=Y
D ^%DT Q:Y'>0
S Y=$P(Y,"."),ENDATE("STARTI")=Y X ^DD("DD") S ENDATE("STARTE")=Y
ACT2 S Y=$$EOM^ENUTL(ENDATE("STARTI")) X ^DD("DD") S %DT("B")=Y
S %DT("A")="Enter stopping date: " K %DT(0)
D ^%DT Q:Y'>0 S Y=$P(Y,"."),ENDATE("STOPI")=Y_".9" X ^DD("DD") S ENDATE("STOPE")=Y
I ENDATE("STOPI")'>ENDATE("STARTI") W !!,"STOPPING DATE must follow the STARTING DATE",*7 G ACT2
S X=$P($O(^ENG(6918,"C",ENDATE("STARTI"))),".") I X=""!(X>ENDATE("STOPI")) W !!,"There was no Y2K activity between "_ENDATE("STARTE")_" and "_ENDATE("STOPE")_".",!,*7 G ACT1
I $P(ENDATE("STOPI"),".",2)="" S ENDATE("STOPI")=ENDATE("STOPI")_".99"
S ENSTN=0
I $P(^DIC(6910,1,0),U,10)!($D(^DIC(6910,1,3))) D G:ENSTN="^" EXIT
. S DIR(0)="Y",DIR("A")="Do you want a breakout by station",DIR("B")="NO"
. S DIR("?",1)="If you say 'NO' you will obtain a single report for all your equipment,"
. S DIR("?")="regardless of which station it belongs to."
. D ^DIR K DIR I $D(DIRUT) S ENSTN="^" Q
. S ENSTN=Y
K IO("Q") S %ZIS="QM" D ^%ZIS G:POP EXIT
I $D(IO("Q")) S ZTRTN="DEQACT^ENY2REP" D G EXIT
. S ZTSAVE("EN*")=""
. S ZTDESC="Y2K Activity Report (equipment)",ZTIO=ION
. D ^%ZTLOAD,HOME^%ZIS K ZTSK
;
DEQACT K ^TMP($J)
N DA,DATE,CAT,EN,TOTAL,STATION,ESCAPE,COST,COUNT,X
D CNTACT,PRNTACT
G EXIT
;
CNTACT ; store target population in ^TMP($J,"ENY2A",
S DATE=ENDATE("STARTI")-.1 F S DATE=$O(^ENG(6918,"C",DATE)) Q:DATE=""!(DATE>ENDATE("STOPI")) S DA(1)=0 F S DA(1)=$O(^ENG(6918,"C",DATE,DA(1))) Q:'DA(1) D:$D(^ENG(6918,DA(1),0))
. I '$D(ZTQUEUED),'(DA(1)#100) W "." ; activity indicator
. S DA=$O(^ENG(6918,"C",DATE,DA(1),0)) Q:'$D(^ENG(6918,DA(1),1,DA,0))
. S ^TMP($J,"ENY2A",DA(1),DATE)=$P(^ENG(6918,DA(1),1,DA,0),U,2)
Q:'$D(^TMP($J))
S STATION("PARNT")=$P(^DIC(6910,1,0),U,2)
; initialization
F J=0,"FC","CC","NC","NA" F K=0,"FC","CC","NC","NA" F L="COUNT","EST","ACT","REST","RACT" S ^TMP($J,"ENY2B",STATION("PARNT"),J,K,L)=0
; end initialization
S DA=0,STATION=STATION("PARNT") F S DA=$O(^TMP($J,"ENY2A",DA)) Q:'DA D READ,WRITE K ^TMP($J,"ENY2A",DA) I '$D(ZTQUEUED),'(DA#100) W "."
Q
;
READ ; extract Y2K activity from skeleton global by date
S DATE("END")=$O(^TMP($J,"ENY2A",DA,9999999),-1),CAT("CHG")=$P(^TMP($J,"ENY2A",DA,DATE("END")),U) S:CAT("CHG")="" CAT("CHG")=0
I $O(^TMP($J,"ENY2A",DA,DATE("END")),-1)="" D Q
. I $O(^ENG(6918,DA,1,"B",ENDATE("STARTI")),-1)="" S CAT("ENT")=CAT("CHG"),CAT("CHG")=0
. E S CAT("ENT")=0
S DATE("BEGIN")=$O(^TMP($J,"ENY2A",DA,ENDATE("STARTI"))),CAT("ENT")=$P(^TMP($J,"ENY2A",DA,DATE("BEGIN")),U)
I $O(^ENG(6918,DA,1,"B",DATE("BEGIN")),-1)]"" S CAT("ENT")=0
Q
;
WRITE ; build global from which report will be drawn (^TMP($J,"ENY2B",)
I ENSTN S STATION=$S($P($G(^ENG(6914,DA,9)),U,5)]"":$P(^(9),U,5),1:STATION("PARNT")) D:'$D(^TMP($J,"ENY2B",STATION))
. F J=0,"FC","NC","CC","NA" F K=0,"FC","NC","CC","NA" F L="COUNT","EST","ACT","REST","RACT" S ^TMP($J,"ENY2B",STATION,J,K,L)=0
S ^TMP($J,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),"COUNT")=^TMP($J,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),"COUNT")+1,EN=$G(^ENG(6914,DA,11))
I CAT("ENT")=0 D Q
. I CAT("CHG")="FC" D CCST Q
. I CAT("CHG")="NC" D NCST Q
. I CAT("CHG")="CC" D CCST Q
I CAT("ENT")="FC" D Q
. I CAT("CHG")="FC" D CCST Q
. I CAT("CHG")="NC" D NCST Q
. I CAT("CHG")="CC" D CCST Q
I CAT("ENT")="NC" D Q
. I CAT("CHG")="NC" D NCST Q
. I CAT("CHG")=0 D NCST Q
. I CAT("CHG")="FC" D CCST Q
. I CAT("CHG")="CC" D CCST Q
I CAT("ENT")="CC" D Q
. I CAT("CHG")="CC" D CCST Q
. I CAT("CHG")=0 D CCST Q
. I CAT("CHG")="FC" D CCST Q
. I CAT("CHG")="NC" D NCST Q
Q
;
CCST ; store Y2K compliance costs
; loc var en contains node 11
S ^TMP($J,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),"EST")=^TMP($J,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),"EST")+$P($P(EN,U,3),".")
S:CAT("CHG")="FC" ^TMP($J,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),"ACT")=^TMP($J,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),"ACT")+$P($P(EN,U,4),".")
Q
;
NCST ; store replacement costs
; loc var en contains node 11
I '$D(COUNT(STATION,CAT("ENT"),CAT("CHG"),"EST")) S COUNT(STATION,CAT("ENT"),CAT("CHG"),"EST")=0
I '$D(COUNT(STATION,CAT("ENT"),CAT("CHG"),"ACT")) S COUNT(STATION,CAT("ENT"),CAT("CHG"),"ACT")=0
I $P(EN,U,6)="REP" D
. S COST("REST")=$P($P($G(^ENG(6914,DA,2)),U,3),".") S:COST("REST")="" COST("REST")=0 S:COST("REST") COUNT(STATION,CAT("ENT"),CAT("CHG"),"EST")=COUNT(STATION,CAT("ENT"),CAT("CHG"),"EST")+1
. S COST("RACT")=0,X=$O(^ENG(6914,"AO",DA,0)) I X,$P($G(^ENG(6914,X,2)),U,4)'>ENDATE("STOPI") D
.. S COST("RACT")=$P($P($G(^ENG(6914,X,2)),U,3),".") S:COST("RACT")="" COST("RACT")=0 S:COST("RACT") COUNT(STATION,CAT("ENT"),CAT("CHG"),"ACT")=COUNT(STATION,CAT("ENT"),CAT("CHG"),"ACT")+1
. F J="REST","RACT" S ^TMP($J,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),J)=^TMP($J,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),J)+COST(J)
Q
;
PRNTACT ; print the hard copy
U IO
N PAGE,LINE
D NOW^%DTC S Y=% X ^DD("DD") S DATE("PRNT")=$P(Y,":",1,2),PAGE=0
W:$E(IOST,1,2)="C-" @IOF
S STATION=0 F S STATION=$O(^TMP($J,"ENY2B",STATION)) Q:STATION=""!($G(ESCAPE)) D HEADR D Q:$G(ESCAPE) D HOLD Q:$G(ESCAPE)
. F J="COUNT","EST","ACT","REST","RACT","ECNT","ACNT" S TOTAL(J)=0
. S TOTAL=0 F J=0,"FC","NC","CC","NA" F K=0,"FC","NC","CC","NA" Q:$G(ESCAPE) I '(J=0&(K=0)),^TMP($J,"ENY2B",STATION,J,K,"COUNT")>0 D Q:$G(ESCAPE)
.. W ! W:J'=0 ?3,J W:K'=0 ?11,K W ?17,$J(^TMP($J,"ENY2B",STATION,J,K,"COUNT"),5),?24,"$" W:^("EST")>0 $J(^("EST"),8) W ?35,"$" W:^("ACT")>0 $J(^("ACT"),8)
.. W ?46,"$" W:^TMP($J,"ENY2B",STATION,J,K,"REST")>0 $J(^("REST"),8)_"("_COUNT(STATION,J,K,"EST")_")" W ?62,"$" W:^("RACT")>0 $J(^("RACT"),8)_"("_COUNT(STATION,J,K,"ACT")_")"
.. S TOTAL("COUNT")=TOTAL("COUNT")+^TMP($J,"ENY2B",STATION,J,K,"COUNT"),TOTAL("EST")=TOTAL("EST")+^("EST"),TOTAL("ACT")=TOTAL("ACT")+^("ACT"),TOTAL=TOTAL+1
.. S TOTAL("REST")=TOTAL("REST")+^TMP($J,"ENY2B",STATION,J,K,"REST"),TOTAL("RACT")=TOTAL("RACT")+^("RACT")
.. S LINE=LINE+1 I (IOSL-LINE)'>2 D HOLD D:'$G(ESCAPE) HEADR
. Q:$G(ESCAPE)
. I 'TOTAL W !!,?10,"<No activity to report>" Q
. W !,X
. I $D(COUNT(STATION,"NC",0)) S TOTAL("ECNT")=TOTAL("ECNT")+$G(COUNT(STATION,"NC",0,"EST")),TOTAL("ACNT")=TOTAL("ACNT")+$G(COUNT(STATION,"NC",0,"ACT"))
. I $D(COUNT(STATION)) F J=0,"FC","NC","CC","NA" I $D(COUNT(STATION,J,"NC")) S TOTAL("ECNT")=TOTAL("ECNT")+$G(COUNT(STATION,J,"NC","EST")),TOTAL("ACNT")=TOTAL("ACNT")+$G(COUNT(STATION,J,"NC","ACT"))
. W !," TOTALS",?17,$J(TOTAL("COUNT"),5),?24,"$"_$J(TOTAL("EST"),8),?35,"$"_$J(TOTAL("ACT"),8),?46,"$"_$J(TOTAL("REST"),8) W:$G(TOTAL("ECNT")) "("_TOTAL("ECNT")_")" W ?62,"$"_$J(TOTAL("RACT"),8) W:$G(TOTAL("ACNT")) "("_TOTAL("ACNT")_")"
Q
;
HEADR ; page header
W:PAGE>0 @IOF S PAGE=PAGE+1,LINE=5
W "Y2K Net Activity Report from "_ENDATE("STARTE")_" to "_ENDATE("STOPE"),?70,"Page: "_PAGE
W !," "_$S('ENSTN:"Consolidated ("_STATION("PARNT")_")",1:"Station: "_STATION),?50,"Printed: "_DATE("PRNT")
W !," Entry Change Count Est Y2K Act Y2K Est Repl(Cnt) Act Repl(Cnt)"
K X S $P(X,"-",79)="-" W !,X,!
Q
;
HOLD Q:$E(IOST,1,2)'="C-"
W !!,"Press <RETURN> to continue, '^' to escape..." R X:DTIME
I '$T!($E(X)="^") S ESCAPE=1
Q
EXIT ;
K ^TMP($J)
D ^%ZISC,HOME^%ZIS
I $D(ZTQUEUED) S ZTREQN="@"
K J,K,X,ENSTN,ENDATE
Q
;ENY2REP
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENY2REP 7892 printed Dec 13, 2024@01:57:24 Page 2
ENY2REP ;;(WIRMFO)/DH-Y2K Activity Report ;8.27.98
+1 ;;7.0;ENGINEERING;**51,55**;August 17, 1993
ACT ; periodic activity report
+1 ; counts and totals of all entries and changes within a user specified
+2 ; date range
+3 NEW %DT
+4 IF $PIECE($GET(^DIC(6910,1,0)),U,2)']""
WRITE !!,"There is no STATION NUMBER in your Engineering Init Parameters file.",!,"Can't proceed.",*7
QUIT
ACT1 SET %DT="AEP"
SET %DT("A")="Enter starting date: "
SET %DT(0)=-DT
+1 SET Y=$EXTRACT(DT,1,5)-1
if $EXTRACT(Y,4,5)="00"
SET Y=($EXTRACT(Y,1,3)-1)_12
SET Y=Y_"01"
+2 XECUTE ^DD("DD")
SET %DT("B")=Y
+3 DO ^%DT
if Y'>0
QUIT
+4 SET Y=$PIECE(Y,".")
SET ENDATE("STARTI")=Y
XECUTE ^DD("DD")
SET ENDATE("STARTE")=Y
ACT2 SET Y=$$EOM^ENUTL(ENDATE("STARTI"))
XECUTE ^DD("DD")
SET %DT("B")=Y
+1 SET %DT("A")="Enter stopping date: "
KILL %DT(0)
+2 DO ^%DT
if Y'>0
QUIT
SET Y=$PIECE(Y,".")
SET ENDATE("STOPI")=Y_".9"
XECUTE ^DD("DD")
SET ENDATE("STOPE")=Y
+3 IF ENDATE("STOPI")'>ENDATE("STARTI")
WRITE !!,"STOPPING DATE must follow the STARTING DATE",*7
GOTO ACT2
+4 SET X=$PIECE($ORDER(^ENG(6918,"C",ENDATE("STARTI"))),".")
IF X=""!(X>ENDATE("STOPI"))
WRITE !!,"There was no Y2K activity between "_ENDATE("STARTE")_" and "_ENDATE("STOPE")_".",!,*7
GOTO ACT1
+5 IF $PIECE(ENDATE("STOPI"),".",2)=""
SET ENDATE("STOPI")=ENDATE("STOPI")_".99"
+6 SET ENSTN=0
+7 IF $PIECE(^DIC(6910,1,0),U,10)!($DATA(^DIC(6910,1,3)))
Begin DoDot:1
+8 SET DIR(0)="Y"
SET DIR("A")="Do you want a breakout by station"
SET DIR("B")="NO"
+9 SET DIR("?",1)="If you say 'NO' you will obtain a single report for all your equipment,"
+10 SET DIR("?")="regardless of which station it belongs to."
+11 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
SET ENSTN="^"
QUIT
+12 SET ENSTN=Y
End DoDot:1
if ENSTN="^"
GOTO EXIT
+13 KILL IO("Q")
SET %ZIS="QM"
DO ^%ZIS
if POP
GOTO EXIT
+14 IF $DATA(IO("Q"))
SET ZTRTN="DEQACT^ENY2REP"
Begin DoDot:1
+15 SET ZTSAVE("EN*")=""
+16 SET ZTDESC="Y2K Activity Report (equipment)"
SET ZTIO=ION
+17 DO ^%ZTLOAD
DO HOME^%ZIS
KILL ZTSK
End DoDot:1
GOTO EXIT
+18 ;
DEQACT KILL ^TMP($JOB)
+1 NEW DA,DATE,CAT,EN,TOTAL,STATION,ESCAPE,COST,COUNT,X
+2 DO CNTACT
DO PRNTACT
+3 GOTO EXIT
+4 ;
CNTACT ; store target population in ^TMP($J,"ENY2A",
+1 SET DATE=ENDATE("STARTI")-.1
FOR
SET DATE=$ORDER(^ENG(6918,"C",DATE))
if DATE=""!(DATE>ENDATE("STOPI"))
QUIT
SET DA(1)=0
FOR
SET DA(1)=$ORDER(^ENG(6918,"C",DATE,DA(1)))
if 'DA(1)
QUIT
if $DATA(^ENG(6918,DA(1),0))
Begin DoDot:1
+2 ; activity indicator
IF '$DATA(ZTQUEUED)
IF '(DA(1)#100)
WRITE "."
+3 SET DA=$ORDER(^ENG(6918,"C",DATE,DA(1),0))
if '$DATA(^ENG(6918,DA(1),1,DA,0))
QUIT
+4 SET ^TMP($JOB,"ENY2A",DA(1),DATE)=$PIECE(^ENG(6918,DA(1),1,DA,0),U,2)
End DoDot:1
+5 if '$DATA(^TMP($JOB))
QUIT
+6 SET STATION("PARNT")=$PIECE(^DIC(6910,1,0),U,2)
+7 ; initialization
+8 FOR J=0,"FC","CC","NC","NA"
FOR K=0,"FC","CC","NC","NA"
FOR L="COUNT","EST","ACT","REST","RACT"
SET ^TMP($JOB,"ENY2B",STATION("PARNT"),J,K,L)=0
+9 ; end initialization
+10 SET DA=0
SET STATION=STATION("PARNT")
FOR
SET DA=$ORDER(^TMP($JOB,"ENY2A",DA))
if 'DA
QUIT
DO READ
DO WRITE
KILL ^TMP($JOB,"ENY2A",DA)
IF '$DATA(ZTQUEUED)
IF '(DA#100)
WRITE "."
+11 QUIT
+12 ;
READ ; extract Y2K activity from skeleton global by date
+1 SET DATE("END")=$ORDER(^TMP($JOB,"ENY2A",DA,9999999),-1)
SET CAT("CHG")=$PIECE(^TMP($JOB,"ENY2A",DA,DATE("END")),U)
if CAT("CHG")=""
SET CAT("CHG")=0
+2 IF $ORDER(^TMP($JOB,"ENY2A",DA,DATE("END")),-1)=""
Begin DoDot:1
+3 IF $ORDER(^ENG(6918,DA,1,"B",ENDATE("STARTI")),-1)=""
SET CAT("ENT")=CAT("CHG")
SET CAT("CHG")=0
+4 IF '$TEST
SET CAT("ENT")=0
End DoDot:1
QUIT
+5 SET DATE("BEGIN")=$ORDER(^TMP($JOB,"ENY2A",DA,ENDATE("STARTI")))
SET CAT("ENT")=$PIECE(^TMP($JOB,"ENY2A",DA,DATE("BEGIN")),U)
+6 IF $ORDER(^ENG(6918,DA,1,"B",DATE("BEGIN")),-1)]""
SET CAT("ENT")=0
+7 QUIT
+8 ;
WRITE ; build global from which report will be drawn (^TMP($J,"ENY2B",)
+1 IF ENSTN
SET STATION=$SELECT($PIECE($GET(^ENG(6914,DA,9)),U,5)]"":$PIECE(^(9),U,5),1:STATION("PARNT"))
if '$DATA(^TMP($JOB,"ENY2B",STATION))
Begin DoDot:1
+2 FOR J=0,"FC","NC","CC","NA"
FOR K=0,"FC","NC","CC","NA"
FOR L="COUNT","EST","ACT","REST","RACT"
SET ^TMP($JOB,"ENY2B",STATION,J,K,L)=0
End DoDot:1
+3 SET ^TMP($JOB,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),"COUNT")=^TMP($JOB,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),"COUNT")+1
SET EN=$GET(^ENG(6914,DA,11))
+4 IF CAT("ENT")=0
Begin DoDot:1
+5 IF CAT("CHG")="FC"
DO CCST
QUIT
+6 IF CAT("CHG")="NC"
DO NCST
QUIT
+7 IF CAT("CHG")="CC"
DO CCST
QUIT
End DoDot:1
QUIT
+8 IF CAT("ENT")="FC"
Begin DoDot:1
+9 IF CAT("CHG")="FC"
DO CCST
QUIT
+10 IF CAT("CHG")="NC"
DO NCST
QUIT
+11 IF CAT("CHG")="CC"
DO CCST
QUIT
End DoDot:1
QUIT
+12 IF CAT("ENT")="NC"
Begin DoDot:1
+13 IF CAT("CHG")="NC"
DO NCST
QUIT
+14 IF CAT("CHG")=0
DO NCST
QUIT
+15 IF CAT("CHG")="FC"
DO CCST
QUIT
+16 IF CAT("CHG")="CC"
DO CCST
QUIT
End DoDot:1
QUIT
+17 IF CAT("ENT")="CC"
Begin DoDot:1
+18 IF CAT("CHG")="CC"
DO CCST
QUIT
+19 IF CAT("CHG")=0
DO CCST
QUIT
+20 IF CAT("CHG")="FC"
DO CCST
QUIT
+21 IF CAT("CHG")="NC"
DO NCST
QUIT
End DoDot:1
QUIT
+22 QUIT
+23 ;
CCST ; store Y2K compliance costs
+1 ; loc var en contains node 11
+2 SET ^TMP($JOB,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),"EST")=^TMP($JOB,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),"EST")+$PIECE($PIECE(EN,U,3),".")
+3 if CAT("CHG")="FC"
SET ^TMP($JOB,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),"ACT")=^TMP($JOB,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),"ACT")+$PIECE($PIECE(EN,U,4),".")
+4 QUIT
+5 ;
NCST ; store replacement costs
+1 ; loc var en contains node 11
+2 IF '$DATA(COUNT(STATION,CAT("ENT"),CAT("CHG"),"EST"))
SET COUNT(STATION,CAT("ENT"),CAT("CHG"),"EST")=0
+3 IF '$DATA(COUNT(STATION,CAT("ENT"),CAT("CHG"),"ACT"))
SET COUNT(STATION,CAT("ENT"),CAT("CHG"),"ACT")=0
+4 IF $PIECE(EN,U,6)="REP"
Begin DoDot:1
+5 SET COST("REST")=$PIECE($PIECE($GET(^ENG(6914,DA,2)),U,3),".")
if COST("REST")=""
SET COST("REST")=0
if COST("REST")
SET COUNT(STATION,CAT("ENT"),CAT("CHG"),"EST")=COUNT(STATION,CAT("ENT"),CAT("CHG"),"EST")+1
+6 SET COST("RACT")=0
SET X=$ORDER(^ENG(6914,"AO",DA,0))
IF X
IF $PIECE($GET(^ENG(6914,X,2)),U,4)'>ENDATE("STOPI")
Begin DoDot:2
+7 SET COST("RACT")=$PIECE($PIECE($GET(^ENG(6914,X,2)),U,3),".")
if COST("RACT")=""
SET COST("RACT")=0
if COST("RACT")
SET COUNT(STATION,CAT("ENT"),CAT("CHG"),"ACT")=COUNT(STATION,CAT("ENT"),CAT("CHG"),"ACT")+1
End DoDot:2
+8 FOR J="REST","RACT"
SET ^TMP($JOB,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),J)=^TMP($JOB,"ENY2B",STATION,CAT("ENT"),CAT("CHG"),J)+COST(J)
End DoDot:1
+9 QUIT
+10 ;
PRNTACT ; print the hard copy
+1 USE IO
+2 NEW PAGE,LINE
+3 DO NOW^%DTC
SET Y=%
XECUTE ^DD("DD")
SET DATE("PRNT")=$PIECE(Y,":",1,2)
SET PAGE=0
+4 if $EXTRACT(IOST,1,2)="C-"
WRITE @IOF
+5 SET STATION=0
FOR
SET STATION=$ORDER(^TMP($JOB,"ENY2B",STATION))
if STATION=""!($GET(ESCAPE))
QUIT
DO HEADR
Begin DoDot:1
+6 FOR J="COUNT","EST","ACT","REST","RACT","ECNT","ACNT"
SET TOTAL(J)=0
+7 SET TOTAL=0
FOR J=0,"FC","NC","CC","NA"
FOR K=0,"FC","NC","CC","NA"
if $GET(ESCAPE)
QUIT
IF '(J=0&(K=0))
IF ^TMP($JOB,"ENY2B",STATION,J,K,"COUNT")>0
Begin DoDot:2
+8 WRITE !
if J'=0
WRITE ?3,J
if K'=0
WRITE ?11,K
WRITE ?17,$JUSTIFY(^TMP($JOB,"ENY2B",STATION,J,K,"COUNT"),5),?24,"$"
if ^("EST")>0
WRITE $JUSTIFY(^("EST"),8)
WRITE ?35,"$"
if ^("ACT")>0
WRITE $JUSTIFY(^("ACT"),8)
+9 WRITE ?46,"$"
if ^TMP($JOB,"ENY2B",STATION,J,K,"REST")>0
WRITE $JUSTIFY(^("REST"),8)_"("_COUNT(STATION,J,K,"EST")_")"
WRITE ?62,"$"
if ^("RACT")>0
WRITE $JUSTIFY(^("RACT"),8)_"("_COUNT(STATION,J,K,"ACT")_")"
+10 SET TOTAL("COUNT")=TOTAL("COUNT")+^TMP($JOB,"ENY2B",STATION,J,K,"COUNT")
SET TOTAL("EST")=TOTAL("EST")+^("EST")
SET TOTAL("ACT")=TOTAL("ACT")+^("ACT")
SET TOTAL=TOTAL+1
+11 SET TOTAL("REST")=TOTAL("REST")+^TMP($JOB,"ENY2B",STATION,J,K,"REST")
SET TOTAL("RACT")=TOTAL("RACT")+^("RACT")
+12 SET LINE=LINE+1
IF (IOSL-LINE)'>2
DO HOLD
if '$GET(ESCAPE)
DO HEADR
End DoDot:2
if $GET(ESCAPE)
QUIT
+13 if $GET(ESCAPE)
QUIT
+14 IF 'TOTAL
WRITE !!,?10,"<No activity to report>"
QUIT
+15 WRITE !,X
+16 IF $DATA(COUNT(STATION,"NC",0))
SET TOTAL("ECNT")=TOTAL("ECNT")+$GET(COUNT(STATION,"NC",0,"EST"))
SET TOTAL("ACNT")=TOTAL("ACNT")+$GET(COUNT(STATION,"NC",0,"ACT"))
+17 IF $DATA(COUNT(STATION))
FOR J=0,"FC","NC","CC","NA"
IF $DATA(COUNT(STATION,J,"NC"))
SET TOTAL("ECNT")=TOTAL("ECNT")+$GET(COUNT(STATION,J,"NC","EST"))
SET TOTAL("ACNT")=TOTAL("ACNT")+$GET(COUNT(STATION,J,"NC","ACT"))
+18 WRITE !," TOTALS",?17,$JUSTIFY(TOTAL("COUNT"),5),?24,"$"_$JUSTIFY(TOTAL("EST"),8),?35,"$"_$JUSTIFY(TOTAL("ACT"),8),?46,"$"_$JUSTIFY(TOTAL("REST"),8)
if $GET(TOTAL("ECNT"))
WRITE "("_TOTAL("ECNT")_")"
WRITE ?62,"$"_$JUSTIFY(TOTAL("RACT"),8)
if $GET(TOTAL("ACNT"))
WRITE "("_TOTAL("ACNT")_")"
End DoDot:1
if $GET(ESCAPE)
QUIT
DO HOLD
if $GET(ESCAPE)
QUIT
+19 QUIT
+20 ;
HEADR ; page header
+1 if PAGE>0
WRITE @IOF
SET PAGE=PAGE+1
SET LINE=5
+2 WRITE "Y2K Net Activity Report from "_ENDATE("STARTE")_" to "_ENDATE("STOPE"),?70,"Page: "_PAGE
+3 WRITE !," "_$SELECT('ENSTN:"Consolidated ("_STATION("PARNT")_")",1:"Station: "_STATION),?50,"Printed: "_DATE("PRNT")
+4 WRITE !," Entry Change Count Est Y2K Act Y2K Est Repl(Cnt) Act Repl(Cnt)"
+5 KILL X
SET $PIECE(X,"-",79)="-"
WRITE !,X,!
+6 QUIT
+7 ;
HOLD if $EXTRACT(IOST,1,2)'="C-"
QUIT
+1 WRITE !!,"Press <RETURN> to continue, '^' to escape..."
READ X:DTIME
+2 IF '$TEST!($EXTRACT(X)="^")
SET ESCAPE=1
+3 QUIT
EXIT ;
+1 KILL ^TMP($JOB)
+2 DO ^%ZISC
DO HOME^%ZIS
+3 IF $DATA(ZTQUEUED)
SET ZTREQN="@"
+4 KILL J,K,X,ENSTN,ENDATE
+5 QUIT
+6 ;ENY2REP