ENY2REP8 ;;(WIRMFO)/DH-Print Y2K Summary Reports ;9.30.98
;;7.0;ENGINEERING;**51,55**;August 17, 1993
;
; extension of ^ENY2REP1
;
DEQUE ; print a summary report
K ^TMP($J)
N CAT,MFG,CSN,DA,COUNT,Y2K,PAGE,LINE,DATE,ESCAPE,TOTAL,STATION
S PAGE=0 D NOW^%DTC S Y=% X ^DD("DD") S DATE("PRNT")=$P(Y,":",1,2)
S STATION("PARNT")=$P(^DIC(6910,1,0),U,2)
; general initialization
S TOTAL(STATION("PARNT"))=0 F J=0,"FC","NC","CC","NA" S TOTAL(STATION("PARNT"),J)=0
; end general initialization
CSN I ENTYPE="CSN" D CSN^ENY2REP7 K ENTYPE,ENSUP,ENSORT,ENSTN G EXIT
;
CAT I ENTYPE="CAT" D K ENTYPE,ENSUP,ENSORT,ENSTN G EXIT
. ; cat initialization
. S CAT(0)=0 F S CAT(0)=$O(^ENG(6914,"G",CAT(0))) Q:'CAT(0) S ^TMP($J,STATION("PARNT"),"COUNT",CAT(0))=0 F J=0,"NA","FC","NC","CC" S ^TMP($J,STATION("PARNT"),CAT(0),J)=0
. ; end cat initialization
. ; begin data gather
. S CAT(0)=0,STATION=STATION("PARNT") F S CAT(0)=$O(^ENG(6914,"G",CAT(0))) Q:'CAT(0) K:'$D(^ENG(6911,CAT(0),0)) ^ENG(6914,"G",CAT(0)) I $D(^ENG(6911,CAT(0),0)) S (DA,COUNT)=0 F S DA=$O(^ENG(6914,"G",CAT(0),DA)) Q:'DA D
.. Q:'$D(^ENG(6914,DA,0))
.. I "^4^5^"[(U_$P($G(^ENG(6914,DA,3)),U)_U) Q
.. I '$D(ZTQUEUED),'(DA#100) W "." ; activity indicator
.. S Y2K=$P($G(^ENG(6914,DA,11)),U) S:Y2K="" Y2K=0
.. I ENSUP,"^NA^FC^"[(U_Y2K_U) Q
.. ; initialize station if need be
.. I ENSTN S STATION=$S($P($G(^ENG(6914,DA,9)),U,5)]"":$P(^(9),U,5),1:STATION("PARNT")) D:'$D(^TMP($J,STATION))
... S TOTAL(STATION)=0 F J=0,"FC","NC","CC","NA" S TOTAL(STATION,J)=0
... S CAT(1)=0 F S CAT(1)=$O(^ENG(6914,"G",CAT(1))) Q:'CAT(1) S ^TMP($J,STATION,"COUNT",CAT(1))=0 F J=0,"FC","NC","CC","NA" S ^TMP($J,STATION,CAT(1),J)=0
... ; end initialize
.. S ^TMP($J,STATION,"COUNT",CAT(0))=^TMP($J,STATION,"COUNT",CAT(0))+1,^TMP($J,STATION,CAT(0),Y2K)=^TMP($J,STATION,CAT(0),Y2K)+1
.. S TOTAL(STATION,Y2K)=TOTAL(STATION,Y2K)+1,TOTAL(STATION)=TOTAL(STATION)+1
.. ; end data gather
. ; begin sort
. S STATION=0 F S STATION=$O(^TMP($J,STATION)) Q:STATION="" S CAT(0)=0 F S CAT(0)=$O(^TMP($J,STATION,"COUNT",CAT(0))) Q:'CAT(0) S COUNT=^TMP($J,STATION,"COUNT",CAT(0)) I COUNT D
.. I $E(ENSORT)="C" D Q
... I $G(ENSORT("MIN"))>COUNT Q
... S ^TMP($J,STATION,"SORT",COUNT,CAT(0))=""
.. S CAT=$P($G(^ENG(6911,CAT(0),0)),U) S:CAT="" CAT=0 S ^TMP($J,STATION,"SORT",CAT,CAT(0))=""
.. ; end sort
. ; print the list
. U IO
. I '$D(^TMP($J)) D HEADR W !!,?15,"<Nothing to print>" D HOLD Q
. S STATION=0 F S STATION=$O(^TMP($J,STATION)) Q:STATION=""!($G(ESCAPE)) D Q:$G(ESCAPE) D HOLD Q:$G(ESCAPE)
.. D HEADR
.. I '$D(^TMP($J,STATION,"SORT")) W !!,"** No records to print **" Q
.. I $E(ENSORT)="C" S J=99999 F S J=$O(^TMP($J,STATION,"SORT",J),-1) Q:'J!($G(ESCAPE)) S CAT(0)=0 F S CAT(0)=$O(^TMP($J,STATION,"SORT",J,CAT(0))) Q:'CAT(0) D PRTCAT Q:$G(ESCAPE) ; J => count
.. I $E(ENSORT)="A" S J="" F S J=$O(^TMP($J,STATION,"SORT",J)) Q:J=""!($G(ESCAPE)) S CAT(0)=0 F S CAT(0)=$O(^TMP($J,STATION,"SORT",J,CAT(0))) Q:'CAT(0) D PRTCAT Q:$G(ESCAPE) ; J => category
.. D TOTALS
;
MFG ; must be by manufacturer
; mfg initialization
S MFG(0)=0 F S MFG(0)=$O(^ENG(6914,"K",MFG(0))) Q:'MFG(0) S ^TMP($J,STATION("PARNT"),"COUNT",MFG(0))=0 F J=0,"NA","FC","NC","CC" S ^TMP($J,STATION("PARNT"),MFG(0),J)=0
; end mfg initialization
; begin data gather
S MFG(0)=0,STATION=STATION("PARNT") F S MFG(0)=$O(^ENG(6914,"K",MFG(0))) Q:'MFG(0) K:'$D(^ENG("MFG",MFG(0),0)) ^ENG(6914,"K",MFG(0)) I $D(^ENG("MFG",MFG(0),0)) S (DA,COUNT)=0 F S DA=$O(^ENG(6914,"K",MFG(0),DA)) Q:'DA D
. Q:'$D(^ENG(6914,DA,0))
. I "^4^5^"[(U_$P($G(^ENG(6914,DA,3)),U)_U) Q
. I '$D(ZTQUEUED),'(DA#100) W "." ; activity indicator
. S Y2K=$P($G(^ENG(6914,DA,11)),U) S:Y2K="" Y2K=0
. I ENSUP,"^NA^FC^"[(U_Y2K_U) Q
. ; initialize station if need be
. I ENSTN S STATION=$S($P($G(^ENG(6914,DA,9)),U,5)]"":$P(^(9),U,5),1:STATION("PARNT")) D:'$D(^TMP($J,STATION))
.. S TOTAL(STATION)=0 F J=0,"FC","NC","CC","NA" S TOTAL(STATION,J)=0
.. S MFG(1)=0 F S MFG(1)=$O(^ENG(6914,"K",MFG(1))) Q:'MFG(1) S ^TMP($J,STATION,"COUNT",MFG(1))=0 F J=0,"FC","NC","CC","NA" S ^TMP($J,STATION,MFG(1),J)=0
.. ; end initialization
. S ^TMP($J,STATION,"COUNT",MFG(0))=^TMP($J,STATION,"COUNT",MFG(0))+1,^TMP($J,STATION,MFG(0),Y2K)=^TMP($J,STATION,MFG(0),Y2K)+1
. S TOTAL(STATION,Y2K)=TOTAL(STATION,Y2K)+1,TOTAL(STATION)=TOTAL(STATION)+1
. ; end data gather
; begin sort
S STATION=0 F S STATION=$O(^TMP($J,STATION)) Q:STATION="" S MFG(0)=0 F S MFG(0)=$O(^TMP($J,STATION,"COUNT",MFG(0))) Q:'MFG(0) S COUNT=^TMP($J,STATION,"COUNT",MFG(0)) I COUNT D
. I $E(ENSORT)="C" D Q
.. I $G(ENSORT("MIN"))>COUNT Q
.. S ^TMP($J,STATION,"SORT",COUNT,MFG(0))=""
. S MFG=$P($G(^ENG("MFG",MFG(0),0)),U) S:MFG="" MFG=0 S ^TMP($J,STATION,"SORT",MFG,MFG(0))=""
. ; end sort
; print the list
U IO
S STATION=0 F S STATION=$O(^TMP($J,STATION)) Q:STATION=""!($G(ESCAPE)) D Q:$G(ESCAPE) D HOLD Q:$G(ESCAPE)
. D HEADR
. I '$D(^TMP($J,STATION,"SORT")) W !!,"** No records to print **" Q
. I $E(ENSORT)="C" S J=99999 F S J=$O(^TMP($J,STATION,"SORT",J),-1) Q:'J!($G(ESCAPE)) S MFG(0)=0 F S MFG(0)=$O(^TMP($J,STATION,"SORT",J,MFG(0))) Q:'MFG(0) D PRTMFG Q:$G(ESCAPE) ; J => count
. I $E(ENSORT)="A" S J="" F S J=$O(^TMP($J,STATION,"SORT",J)) Q:J=""!($G(ESCAPE)) S MFG(0)=0 F S MFG(0)=$O(^TMP($J,STATION,"SORT",J,MFG(0))) Q:'MFG(0) D PRTMFG Q:$G(ESCAPE) ; J => manufacturer
. D TOTALS
K ENTYPE,ENSUP,ENSORT,ENSTN
G EXIT
;
PRTCAT I ENSUP W !,$E($P(^ENG(6911,CAT(0),0),U),1,30),?42,$J(^TMP($J,STATION,CAT(0),"NC"),5),?49,$J(^("CC"),5),?63,$J(^(0),5),?71,$J(^TMP($J,STATION,"COUNT",CAT(0)),5)
I 'ENSUP W !,$E($P(^ENG(6911,CAT(0),0),U),1,30),?35,$J(^TMP($J,STATION,CAT(0),"FC"),5),?42,$J(^("NC"),5),?49,$J(^("CC"),5),?56,$J(^("NA"),5),?63,$J(^(0),5),?71,$J(^TMP($J,STATION,"COUNT",CAT(0)),5)
S LINE=LINE+1 I (IOSL-LINE)'>4 D HOLD Q:$G(ESCAPE) I $O(^TMP($J,STATION,"SORT",J,CAT(0)))!($O(^TMP($J,STATION,"SORT",J))]"")!($O(^TMP($J,STATION))]"") D HEADR
Q
;
PRTMFG I ENSUP W !,$E($P(^ENG("MFG",MFG(0),0),U),1,30),?42,$J(^TMP($J,STATION,MFG(0),"NC"),5),?49,$J(^("CC"),5),?63,$J(^(0),5),?71,$J(^TMP($J,STATION,"COUNT",MFG(0)),5)
I 'ENSUP W !,$E($P(^ENG("MFG",MFG(0),0),U),1,30),?35,$J(^TMP($J,STATION,MFG(0),"FC"),5),?42,$J(^("NC"),5),?49,$J(^("CC"),5),?56,$J(^("NA"),5),?63,$J(^(0),5),?71,$J(^TMP($J,STATION,"COUNT",MFG(0)),5)
S LINE=LINE+1 I (IOSL-LINE)'>4 D HOLD Q:$G(ESCAPE) I $O(^TMP($J,STATION,"SORT",J,MFG(0)))!($O(^TMP($J,STATION,"SORT",J))]"")!($O(^TMP($J,STATION))]"") D HEADR
Q
;
TOTALS ; skip totals if printing high counts only
Q:$G(ESCAPE)!($G(ENSORT("MIN"))>1)
K X S $P(X,"-",79)="-" W !,X
I ENSUP W !,"TOTALS",?42,$J(TOTAL(STATION,"NC"),5),?49,$J(TOTAL(STATION,"CC"),5),?63,$J(TOTAL(STATION,0),5),?71,$J(TOTAL(STATION),5)
I 'ENSUP W !,"TOTALS",?35,$J(TOTAL(STATION,"FC"),5),?42,$J(TOTAL(STATION,"NC"),5),?49,$J(TOTAL(STATION,"CC"),5),?56,$J(TOTAL(STATION,"NA"),5),?63,$J(TOTAL(STATION,0),5),?71,$J(TOTAL(STATION),5)
Q
;
HEADR ; header for summary listing
W:PAGE>0!($E(IOST,1,2)="C-") @IOF S PAGE=PAGE+1,LINE=4
W "Y2K Data by "_$S(ENTYPE="CAT":"EQUIPMENT CATEGORY",1:"MANUFACTURER "),?45,DATE("PRNT"),?70,"Page: "_PAGE
W !,$S('ENSTN:"Consolidated ("_STATION("PARNT")_") ",1:"Station: "_STATION_" ")
I ENSUP W "(Y2K CATEGORIES 'FC' and 'NA' are being ignored.)"
W !,$S(ENTYPE="CAT":"EQUIPMENT CATEGORY NAME",1:"MANUFACTURER NAME"),?38,"FC",?45,"NC",?52,"CC",?59,"NA",?64,"NULL",?71,"TOTAL"
K X S $P(X,"-",79)="-" W !,X
Q
;
HOLD Q:$E(IOST,1,2)'="C-"!($G(ESCAPE))
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
Q
;ENY2REP8
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENY2REP8 7860 printed Dec 13, 2024@01:57:31 Page 2
ENY2REP8 ;;(WIRMFO)/DH-Print Y2K Summary Reports ;9.30.98
+1 ;;7.0;ENGINEERING;**51,55**;August 17, 1993
+2 ;
+3 ; extension of ^ENY2REP1
+4 ;
DEQUE ; print a summary report
+1 KILL ^TMP($JOB)
+2 NEW CAT,MFG,CSN,DA,COUNT,Y2K,PAGE,LINE,DATE,ESCAPE,TOTAL,STATION
+3 SET PAGE=0
DO NOW^%DTC
SET Y=%
XECUTE ^DD("DD")
SET DATE("PRNT")=$PIECE(Y,":",1,2)
+4 SET STATION("PARNT")=$PIECE(^DIC(6910,1,0),U,2)
+5 ; general initialization
+6 SET TOTAL(STATION("PARNT"))=0
FOR J=0,"FC","NC","CC","NA"
SET TOTAL(STATION("PARNT"),J)=0
+7 ; end general initialization
CSN IF ENTYPE="CSN"
DO CSN^ENY2REP7
KILL ENTYPE,ENSUP,ENSORT,ENSTN
GOTO EXIT
+1 ;
CAT IF ENTYPE="CAT"
Begin DoDot:1
+1 ; cat initialization
+2 SET CAT(0)=0
FOR
SET CAT(0)=$ORDER(^ENG(6914,"G",CAT(0)))
if 'CAT(0)
QUIT
SET ^TMP($JOB,STATION("PARNT"),"COUNT",CAT(0))=0
FOR J=0,"NA","FC","NC","CC"
SET ^TMP($JOB,STATION("PARNT"),CAT(0),J)=0
+3 ; end cat initialization
+4 ; begin data gather
+5 SET CAT(0)=0
SET STATION=STATION("PARNT")
FOR
SET CAT(0)=$ORDER(^ENG(6914,"G",CAT(0)))
if 'CAT(0)
QUIT
if '$DATA(^ENG(6911,CAT(0),0))
KILL ^ENG(6914,"G",CAT(0))
IF $DATA(^ENG(6911,CAT(0),0))
SET (DA,COUNT)=0
FOR
SET DA=$ORDER(^ENG(6914,"G",CAT(0),DA))
if 'DA
QUIT
Begin DoDot:2
+6 if '$DATA(^ENG(6914,DA,0))
QUIT
+7 IF "^4^5^"[(U_$PIECE($GET(^ENG(6914,DA,3)),U)_U)
QUIT
+8 ; activity indicator
IF '$DATA(ZTQUEUED)
IF '(DA#100)
WRITE "."
+9 SET Y2K=$PIECE($GET(^ENG(6914,DA,11)),U)
if Y2K=""
SET Y2K=0
+10 IF ENSUP
IF "^NA^FC^"[(U_Y2K_U)
QUIT
+11 ; initialize station if need be
+12 IF ENSTN
SET STATION=$SELECT($PIECE($GET(^ENG(6914,DA,9)),U,5)]"":$PIECE(^(9),U,5),1:STATION("PARNT"))
if '$DATA(^TMP($JOB,STATION))
Begin DoDot:3
+13 SET TOTAL(STATION)=0
FOR J=0,"FC","NC","CC","NA"
SET TOTAL(STATION,J)=0
+14 SET CAT(1)=0
FOR
SET CAT(1)=$ORDER(^ENG(6914,"G",CAT(1)))
if 'CAT(1)
QUIT
SET ^TMP($JOB,STATION,"COUNT",CAT(1))=0
FOR J=0,"FC","NC","CC","NA"
SET ^TMP($JOB,STATION,CAT(1),J)=0
+15 ; end initialize
End DoDot:3
+16 SET ^TMP($JOB,STATION,"COUNT",CAT(0))=^TMP($JOB,STATION,"COUNT",CAT(0))+1
SET ^TMP($JOB,STATION,CAT(0),Y2K)=^TMP($JOB,STATION,CAT(0),Y2K)+1
+17 SET TOTAL(STATION,Y2K)=TOTAL(STATION,Y2K)+1
SET TOTAL(STATION)=TOTAL(STATION)+1
+18 ; end data gather
End DoDot:2
+19 ; begin sort
+20 SET STATION=0
FOR
SET STATION=$ORDER(^TMP($JOB,STATION))
if STATION=""
QUIT
SET CAT(0)=0
FOR
SET CAT(0)=$ORDER(^TMP($JOB,STATION,"COUNT",CAT(0)))
if 'CAT(0)
QUIT
SET COUNT=^TMP($JOB,STATION,"COUNT",CAT(0))
IF COUNT
Begin DoDot:2
+21 IF $EXTRACT(ENSORT)="C"
Begin DoDot:3
+22 IF $GET(ENSORT("MIN"))>COUNT
QUIT
+23 SET ^TMP($JOB,STATION,"SORT",COUNT,CAT(0))=""
End DoDot:3
QUIT
+24 SET CAT=$PIECE($GET(^ENG(6911,CAT(0),0)),U)
if CAT=""
SET CAT=0
SET ^TMP($JOB,STATION,"SORT",CAT,CAT(0))=""
+25 ; end sort
End DoDot:2
+26 ; print the list
+27 USE IO
+28 IF '$DATA(^TMP($JOB))
DO HEADR
WRITE !!,?15,"<Nothing to print>"
DO HOLD
QUIT
+29 SET STATION=0
FOR
SET STATION=$ORDER(^TMP($JOB,STATION))
if STATION=""!($GET(ESCAPE))
QUIT
Begin DoDot:2
+30 DO HEADR
+31 IF '$DATA(^TMP($JOB,STATION,"SORT"))
WRITE !!,"** No records to print **"
QUIT
+32 ; J => count
IF $EXTRACT(ENSORT)="C"
SET J=99999
FOR
SET J=$ORDER(^TMP($JOB,STATION,"SORT",J),-1)
if 'J!($GET(ESCAPE))
QUIT
SET CAT(0)=0
FOR
SET CAT(0)=$ORDER(^TMP($JOB,STATION,"SORT",J,CAT(0)))
if 'CAT(0)
QUIT
DO PRTCAT
if $GET(ESCAPE)
QUIT
+33 ; J => category
IF $EXTRACT(ENSORT)="A"
SET J=""
FOR
SET J=$ORDER(^TMP($JOB,STATION,"SORT",J))
if J=""!($GET(ESCAPE))
QUIT
SET CAT(0)=0
FOR
SET CAT(0)=$ORDER(^TMP($JOB,STATION,"SORT",J,CAT(0)))
if 'CAT(0)
QUIT
DO PRTCAT
if $GET(ESCAPE)
QUIT
+34 DO TOTALS
End DoDot:2
if $GET(ESCAPE)
QUIT
DO HOLD
if $GET(ESCAPE)
QUIT
End DoDot:1
KILL ENTYPE,ENSUP,ENSORT,ENSTN
GOTO EXIT
+35 ;
MFG ; must be by manufacturer
+1 ; mfg initialization
+2 SET MFG(0)=0
FOR
SET MFG(0)=$ORDER(^ENG(6914,"K",MFG(0)))
if 'MFG(0)
QUIT
SET ^TMP($JOB,STATION("PARNT"),"COUNT",MFG(0))=0
FOR J=0,"NA","FC","NC","CC"
SET ^TMP($JOB,STATION("PARNT"),MFG(0),J)=0
+3 ; end mfg initialization
+4 ; begin data gather
+5 SET MFG(0)=0
SET STATION=STATION("PARNT")
FOR
SET MFG(0)=$ORDER(^ENG(6914,"K",MFG(0)))
if 'MFG(0)
QUIT
if '$DATA(^ENG("MFG",MFG(0),0))
KILL ^ENG(6914,"K",MFG(0))
IF $DATA(^ENG("MFG",MFG(0),0))
SET (DA,COUNT)=0
FOR
SET DA=$ORDER(^ENG(6914,"K",MFG(0),DA))
if 'DA
QUIT
Begin DoDot:1
+6 if '$DATA(^ENG(6914,DA,0))
QUIT
+7 IF "^4^5^"[(U_$PIECE($GET(^ENG(6914,DA,3)),U)_U)
QUIT
+8 ; activity indicator
IF '$DATA(ZTQUEUED)
IF '(DA#100)
WRITE "."
+9 SET Y2K=$PIECE($GET(^ENG(6914,DA,11)),U)
if Y2K=""
SET Y2K=0
+10 IF ENSUP
IF "^NA^FC^"[(U_Y2K_U)
QUIT
+11 ; initialize station if need be
+12 IF ENSTN
SET STATION=$SELECT($PIECE($GET(^ENG(6914,DA,9)),U,5)]"":$PIECE(^(9),U,5),1:STATION("PARNT"))
if '$DATA(^TMP($JOB,STATION))
Begin DoDot:2
+13 SET TOTAL(STATION)=0
FOR J=0,"FC","NC","CC","NA"
SET TOTAL(STATION,J)=0
+14 SET MFG(1)=0
FOR
SET MFG(1)=$ORDER(^ENG(6914,"K",MFG(1)))
if 'MFG(1)
QUIT
SET ^TMP($JOB,STATION,"COUNT",MFG(1))=0
FOR J=0,"FC","NC","CC","NA"
SET ^TMP($JOB,STATION,MFG(1),J)=0
+15 ; end initialization
End DoDot:2
+16 SET ^TMP($JOB,STATION,"COUNT",MFG(0))=^TMP($JOB,STATION,"COUNT",MFG(0))+1
SET ^TMP($JOB,STATION,MFG(0),Y2K)=^TMP($JOB,STATION,MFG(0),Y2K)+1
+17 SET TOTAL(STATION,Y2K)=TOTAL(STATION,Y2K)+1
SET TOTAL(STATION)=TOTAL(STATION)+1
+18 ; end data gather
End DoDot:1
+19 ; begin sort
+20 SET STATION=0
FOR
SET STATION=$ORDER(^TMP($JOB,STATION))
if STATION=""
QUIT
SET MFG(0)=0
FOR
SET MFG(0)=$ORDER(^TMP($JOB,STATION,"COUNT",MFG(0)))
if 'MFG(0)
QUIT
SET COUNT=^TMP($JOB,STATION,"COUNT",MFG(0))
IF COUNT
Begin DoDot:1
+21 IF $EXTRACT(ENSORT)="C"
Begin DoDot:2
+22 IF $GET(ENSORT("MIN"))>COUNT
QUIT
+23 SET ^TMP($JOB,STATION,"SORT",COUNT,MFG(0))=""
End DoDot:2
QUIT
+24 SET MFG=$PIECE($GET(^ENG("MFG",MFG(0),0)),U)
if MFG=""
SET MFG=0
SET ^TMP($JOB,STATION,"SORT",MFG,MFG(0))=""
+25 ; end sort
End DoDot:1
+26 ; print the list
+27 USE IO
+28 SET STATION=0
FOR
SET STATION=$ORDER(^TMP($JOB,STATION))
if STATION=""!($GET(ESCAPE))
QUIT
Begin DoDot:1
+29 DO HEADR
+30 IF '$DATA(^TMP($JOB,STATION,"SORT"))
WRITE !!,"** No records to print **"
QUIT
+31 ; J => count
IF $EXTRACT(ENSORT)="C"
SET J=99999
FOR
SET J=$ORDER(^TMP($JOB,STATION,"SORT",J),-1)
if 'J!($GET(ESCAPE))
QUIT
SET MFG(0)=0
FOR
SET MFG(0)=$ORDER(^TMP($JOB,STATION,"SORT",J,MFG(0)))
if 'MFG(0)
QUIT
DO PRTMFG
if $GET(ESCAPE)
QUIT
+32 ; J => manufacturer
IF $EXTRACT(ENSORT)="A"
SET J=""
FOR
SET J=$ORDER(^TMP($JOB,STATION,"SORT",J))
if J=""!($GET(ESCAPE))
QUIT
SET MFG(0)=0
FOR
SET MFG(0)=$ORDER(^TMP($JOB,STATION,"SORT",J,MFG(0)))
if 'MFG(0)
QUIT
DO PRTMFG
if $GET(ESCAPE)
QUIT
+33 DO TOTALS
End DoDot:1
if $GET(ESCAPE)
QUIT
DO HOLD
if $GET(ESCAPE)
QUIT
+34 KILL ENTYPE,ENSUP,ENSORT,ENSTN
+35 GOTO EXIT
+36 ;
PRTCAT IF ENSUP
WRITE !,$EXTRACT($PIECE(^ENG(6911,CAT(0),0),U),1,30),?42,$JUSTIFY(^TMP($JOB,STATION,CAT(0),"NC"),5),?49,$JUSTIFY(^("CC"),5),?63,$JUSTIFY(^(0),5),?71,$JUSTIFY(^TMP($JOB,STATION,"COUNT",CAT(0)),5)
+1 IF 'ENSUP
WRITE !,$EXTRACT($PIECE(^ENG(6911,CAT(0),0),U),1,30),?35,$JUSTIFY(^TMP($JOB,STATION,CAT(0),"FC"),5),?42,$JUSTIFY(^("NC"),5),?49,$JUSTIFY(^("CC"),5),?56,$JUSTIFY(^("NA"),5),?63,$JUSTIFY(^(0),5),?71,$JUSTIFY(^TMP($JOB,STATION,"COUNT",CAT(0)),
5)
+2 SET LINE=LINE+1
IF (IOSL-LINE)'>4
DO HOLD
if $GET(ESCAPE)
QUIT
IF $ORDER(^TMP($JOB,STATION,"SORT",J,CAT(0)))!($ORDER(^TMP($JOB,STATION,"SORT",J))]"")!($ORDER(^TMP($JOB,STATION))]"")
DO HEADR
+3 QUIT
+4 ;
PRTMFG IF ENSUP
WRITE !,$EXTRACT($PIECE(^ENG("MFG",MFG(0),0),U),1,30),?42,$JUSTIFY(^TMP($JOB,STATION,MFG(0),"NC"),5),?49,$JUSTIFY(^("CC"),5),?63,$JUSTIFY(^(0),5),?71,$JUSTIFY(^TMP($JOB,STATION,"COUNT",MFG(0)),5)
+1 IF 'ENSUP
WRITE !,$EXTRACT($PIECE(^ENG("MFG",MFG(0),0),U),1,30),?35,$JUSTIFY(^TMP($JOB,STATION,MFG(0),"FC"),5),?42,$JUSTIFY(^("NC"),5),?49,$JUSTIFY(^("CC"),5),?56,$JUSTIFY(^("NA"),5),?63,$JUSTIFY(^(0),5),?71,$JUSTIFY(^TMP($JOB,STATION,"COUNT",MFG(0))
,5)
+2 SET LINE=LINE+1
IF (IOSL-LINE)'>4
DO HOLD
if $GET(ESCAPE)
QUIT
IF $ORDER(^TMP($JOB,STATION,"SORT",J,MFG(0)))!($ORDER(^TMP($JOB,STATION,"SORT",J))]"")!($ORDER(^TMP($JOB,STATION))]"")
DO HEADR
+3 QUIT
+4 ;
TOTALS ; skip totals if printing high counts only
+1 if $GET(ESCAPE)!($GET(ENSORT("MIN"))>1)
QUIT
+2 KILL X
SET $PIECE(X,"-",79)="-"
WRITE !,X
+3 IF ENSUP
WRITE !,"TOTALS",?42,$JUSTIFY(TOTAL(STATION,"NC"),5),?49,$JUSTIFY(TOTAL(STATION,"CC"),5),?63,$JUSTIFY(TOTAL(STATION,0),5),?71,$JUSTIFY(TOTAL(STATION),5)
+4 IF 'ENSUP
WRITE !,"TOTALS",?35,$JUSTIFY(TOTAL(STATION,"FC"),5),?42,$JUSTIFY(TOTAL(STATION,"NC"),5),?49,$JUSTIFY(TOTAL(STATION,"CC"),5),?56,$JUSTIFY(TOTAL(STATION,"NA"),5),?63,$JUSTIFY(TOTAL(STATION,0),5),?71,$JUSTIFY(TOTAL(STATION),5)
+5 QUIT
+6 ;
HEADR ; header for summary listing
+1 if PAGE>0!($EXTRACT(IOST,1,2)="C-")
WRITE @IOF
SET PAGE=PAGE+1
SET LINE=4
+2 WRITE "Y2K Data by "_$SELECT(ENTYPE="CAT":"EQUIPMENT CATEGORY",1:"MANUFACTURER "),?45,DATE("PRNT"),?70,"Page: "_PAGE
+3 WRITE !,$SELECT('ENSTN:"Consolidated ("_STATION("PARNT")_") ",1:"Station: "_STATION_" ")
+4 IF ENSUP
WRITE "(Y2K CATEGORIES 'FC' and 'NA' are being ignored.)"
+5 WRITE !,$SELECT(ENTYPE="CAT":"EQUIPMENT CATEGORY NAME",1:"MANUFACTURER NAME"),?38,"FC",?45,"NC",?52,"CC",?59,"NA",?64,"NULL",?71,"TOTAL"
+6 KILL X
SET $PIECE(X,"-",79)="-"
WRITE !,X
+7 QUIT
+8 ;
HOLD if $EXTRACT(IOST,1,2)'="C-"!($GET(ESCAPE))
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
+5 QUIT
+6 ;ENY2REP8