ENY2REP5 ;;(WIRMFO)/DH-Overall Y2K Status by Man~Mod ;9.30.98
;;7.0;ENGINEERING;**51,55**;August 17, 1993
VIEW ; status of Y2K data base by manufacturer~model
; counts only, no costing information
W @IOF,!!,?20,"** STATUS OF Y2K EQUIPMENT DATA BASE **"
I $P($G(^DIC(6910,1,0)),U,2)']"" W !!,"There is no STATION NUMBER in your Engineering Init Paramaters file.",!,"Can't proceed.",*7 Q
S ALLSTN=0
I $P(^DIC(6910,1,0),U,10)!($D(^DIC(6910,1,3))) D
. W !! 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 ALLSTN="^" Q
. S ALLSTN=Y
I ALLSTN=U K ALLSTN Q
W !! S DIR(0)="YA",DIR("A")="Shall we ignore equipment records with no Y2K issues? ",DIR("B")="YES"
S DIR("?",1)="Enter YES if you do not wish the counts to include equipment records for"
S DIR("?")="which the Y2K CATEGORY is 'FC' or 'NA'."
D ^DIR K DIR I $D(DIRUT) K ALLSTN Q
S ENSUP=Y
W !! K IO("Q") S %ZIS="QM" D ^%ZIS I POP K ALLSTN,ENSUP Q
I $D(IO("Q")) S ZTRTN="VIEW1^ENY2REP5" D K ALLSTN,ENSUP G EXIT
. S ZTDESC="Y2K Equipment Snapshot",ZTIO=ION
. S ZTSAVE("ALLSTN")="",ZTSAVE("ENSUP")=""
. D ^%ZTLOAD,HOME^%ZIS K ZTSK
;
VIEW1 K ^TMP($J)
N MAN,MOD,CAT,PAGE,DATE,LINE,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($G(^DIC(6910,1,0)),U,2)
S STATION=STATION("PARNT")
S TOTAL(STATION,"GRAND")=0 F J=0,"FC","NC","CC","NA" S TOTAL(STATION,J)=0 ; initialize
S MAN=0 F S MAN=$O(^ENG(6914,"K",MAN)) Q:'MAN S MAN("E")=$P($G(^ENG("MFG",MAN,0)),U) D:MAN("E")]""
. S DA=0 F S DA=$O(^ENG(6914,"K",MAN,DA)) Q:'DA S MOD=$P($G(^ENG(6914,DA,1)),U,2) D:MOD]""
.. I '$P(^ENG(6914,DA,1),U,4) K ^ENG(6914,"K",MAN,DA) S DA=$O(^ENG(6914,"K",MAN,DA),-1) Q ;broken x-ref
.. I "^4^5^"[(U_$P($G(^ENG(6914,DA,3)),U)_U) Q ;inactive record
.. S CAT=$P($G(^ENG(6914,DA,11)),U) S:CAT="" CAT=0
.. I '$D(ZTQUEUED),'(DA#100) W "." ; activity indicator
.. I ENSUP,"^FC^NA^"[(U_CAT_U) Q ; suppress the 'don't cares'
.. I ALLSTN S STATION=$S($P($G(^ENG(6914,DA,9)),U,5)]"":$P(^(9),U,5),1:STATION("PARNT")) D:'$D(TOTAL(STATION))
... S TOTAL(STATION,"GRAND")=0 F J=0,"FC","NC","CC","NA" S TOTAL(STATION,J)=0
.. I '$D(^TMP($J,STATION,MAN("E"),MOD,CAT)) F J=0,"FC","NC","CC","NA" S ^TMP($J,STATION,MAN("E"),MOD,J)=0
.. S ^TMP($J,STATION,MAN("E"),MOD,CAT)=^(CAT)+1,TOTAL(STATION,CAT)=TOTAL(STATION,CAT)+1
.. S TOTAL(STATION,"GRAND")=TOTAL(STATION,"GRAND")+1
;
VIEWPRT ; print the snapshot
U IO
I '$D(^TMP($J)) D VIEWHDR W !!,?15,"<Nothing to print>" D HOLD G EXIT
S STATION=0 F S STATION=$O(^TMP($J,STATION)) Q:STATION="" D VIEWHDR D D:'$G(ESCAPE) HOLD Q:$G(ESCAPE) W @IOF
. S MAN("E")=0 S (MOD,ESCAPE)=0 F S MAN("E")=$O(^TMP($J,STATION,MAN("E"))) Q:MAN("E")="" S MAN("PRNT")=$E(MAN("E"),1,20) F S MOD=$O(^TMP($J,STATION,MAN("E"),MOD)) Q:MOD=""!(ESCAPE) S MOD("E")=$E(MOD,1,14) D
.. W !,MAN("PRNT")_"~"_MOD("E"),?42 W:'ENSUP $J(^TMP($J,STATION,MAN("E"),MOD,"FC"),5) W ?48,$J(^TMP($J,STATION,MAN("E"),MOD,"NC"),5),?54,$J(^("CC"),5)
.. W ?60 W:'ENSUP $J(^TMP($J,STATION,MAN("E"),MOD,"NA"),5) W ?66,$J(^TMP($J,STATION,MAN("E"),MOD,0),5)
.. S TOTAL=0 F J=0,"FC","NC","CC","NA" S TOTAL=TOTAL+^TMP($J,STATION,MAN("E"),MOD,J)
.. W ?72,$J(TOTAL,5)
.. K ^TMP($J,STATION,MAN("E"),MOD)
.. S LINE=LINE+1 I (IOSL-LINE)'>4 D HOLD Q:ESCAPE D:$D(^TMP($J)) VIEWHDR
. I '$G(ESCAPE) D
.. K X S $P(X,"-",79)="-" W !,X
.. W !,"TOTALS",?42 W:'ENSUP $J(TOTAL(STATION,"FC"),5) W ?48,$J(TOTAL(STATION,"NC"),5),?54,$J(TOTAL(STATION,"CC"),5),?60 W:'ENSUP $J(TOTAL(STATION,"NA"),5) W ?66,$J(TOTAL(STATION,0),5),?72,$J(TOTAL(STATION,"GRAND"),5)
G EXIT
;
VIEWHDR ; header for Y2K snapshot
W:$E(IOST,1,2)="C-"!(PAGE) @IOF S PAGE=PAGE+1,LINE=3
W "Y2K Equipment Status - Counts Only Printed: "_DATE("PRNT")_" Page: "_PAGE
I ENSUP W !,"Equipment Records with Y2K Category of 'FC' or 'NA' are not being counted." S LINE=LINE+1
W !,"Manufacturer~Model "_$S('ALLSTN:"(Consolidated: "_STATION("PARNT")_")",1:"(Station: "_STATION_")"),?45,"FC NC CC NA Null TOTAL"
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,ALLSTN,ENSUP
Q
;ENY2REP5
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENY2REP5 4535 printed Dec 13, 2024@01:57:29 Page 2
ENY2REP5 ;;(WIRMFO)/DH-Overall Y2K Status by Man~Mod ;9.30.98
+1 ;;7.0;ENGINEERING;**51,55**;August 17, 1993
VIEW ; status of Y2K data base by manufacturer~model
+1 ; counts only, no costing information
+2 WRITE @IOF,!!,?20,"** STATUS OF Y2K EQUIPMENT DATA BASE **"
+3 IF $PIECE($GET(^DIC(6910,1,0)),U,2)']""
WRITE !!,"There is no STATION NUMBER in your Engineering Init Paramaters file.",!,"Can't proceed.",*7
QUIT
+4 SET ALLSTN=0
+5 IF $PIECE(^DIC(6910,1,0),U,10)!($DATA(^DIC(6910,1,3)))
Begin DoDot:1
+6 WRITE !!
SET DIR(0)="Y"
SET DIR("A")="Do you want a breakout by station"
SET DIR("B")="NO"
+7 SET DIR("?",1)="If you say 'NO' you will obtain a single report for all your equipment,"
+8 SET DIR("?")="regardless of which station it belongs to."
+9 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
SET ALLSTN="^"
QUIT
+10 SET ALLSTN=Y
End DoDot:1
+11 IF ALLSTN=U
KILL ALLSTN
QUIT
+12 WRITE !!
SET DIR(0)="YA"
SET DIR("A")="Shall we ignore equipment records with no Y2K issues? "
SET DIR("B")="YES"
+13 SET DIR("?",1)="Enter YES if you do not wish the counts to include equipment records for"
+14 SET DIR("?")="which the Y2K CATEGORY is 'FC' or 'NA'."
+15 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
KILL ALLSTN
QUIT
+16 SET ENSUP=Y
+17 WRITE !!
KILL IO("Q")
SET %ZIS="QM"
DO ^%ZIS
IF POP
KILL ALLSTN,ENSUP
QUIT
+18 IF $DATA(IO("Q"))
SET ZTRTN="VIEW1^ENY2REP5"
Begin DoDot:1
+19 SET ZTDESC="Y2K Equipment Snapshot"
SET ZTIO=ION
+20 SET ZTSAVE("ALLSTN")=""
SET ZTSAVE("ENSUP")=""
+21 DO ^%ZTLOAD
DO HOME^%ZIS
KILL ZTSK
End DoDot:1
KILL ALLSTN,ENSUP
GOTO EXIT
+22 ;
VIEW1 KILL ^TMP($JOB)
+1 NEW MAN,MOD,CAT,PAGE,DATE,LINE,ESCAPE,TOTAL,STATION
+2 SET PAGE=0
DO NOW^%DTC
SET Y=%
XECUTE ^DD("DD")
SET DATE("PRNT")=$PIECE(Y,":",1,2)
+3 SET STATION("PARNT")=$PIECE($GET(^DIC(6910,1,0)),U,2)
+4 SET STATION=STATION("PARNT")
+5 ; initialize
SET TOTAL(STATION,"GRAND")=0
FOR J=0,"FC","NC","CC","NA"
SET TOTAL(STATION,J)=0
+6 SET MAN=0
FOR
SET MAN=$ORDER(^ENG(6914,"K",MAN))
if 'MAN
QUIT
SET MAN("E")=$PIECE($GET(^ENG("MFG",MAN,0)),U)
if MAN("E")]""
Begin DoDot:1
+7 SET DA=0
FOR
SET DA=$ORDER(^ENG(6914,"K",MAN,DA))
if 'DA
QUIT
SET MOD=$PIECE($GET(^ENG(6914,DA,1)),U,2)
if MOD]""
Begin DoDot:2
+8 ;broken x-ref
IF '$PIECE(^ENG(6914,DA,1),U,4)
KILL ^ENG(6914,"K",MAN,DA)
SET DA=$ORDER(^ENG(6914,"K",MAN,DA),-1)
QUIT
+9 ;inactive record
IF "^4^5^"[(U_$PIECE($GET(^ENG(6914,DA,3)),U)_U)
QUIT
+10 SET CAT=$PIECE($GET(^ENG(6914,DA,11)),U)
if CAT=""
SET CAT=0
+11 ; activity indicator
IF '$DATA(ZTQUEUED)
IF '(DA#100)
WRITE "."
+12 ; suppress the 'don't cares'
IF ENSUP
IF "^FC^NA^"[(U_CAT_U)
QUIT
+13 IF ALLSTN
SET STATION=$SELECT($PIECE($GET(^ENG(6914,DA,9)),U,5)]"":$PIECE(^(9),U,5),1:STATION("PARNT"))
if '$DATA(TOTAL(STATION))
Begin DoDot:3
+14 SET TOTAL(STATION,"GRAND")=0
FOR J=0,"FC","NC","CC","NA"
SET TOTAL(STATION,J)=0
End DoDot:3
+15 IF '$DATA(^TMP($JOB,STATION,MAN("E"),MOD,CAT))
FOR J=0,"FC","NC","CC","NA"
SET ^TMP($JOB,STATION,MAN("E"),MOD,J)=0
+16 SET ^TMP($JOB,STATION,MAN("E"),MOD,CAT)=^(CAT)+1
SET TOTAL(STATION,CAT)=TOTAL(STATION,CAT)+1
+17 SET TOTAL(STATION,"GRAND")=TOTAL(STATION,"GRAND")+1
End DoDot:2
End DoDot:1
+18 ;
VIEWPRT ; print the snapshot
+1 USE IO
+2 IF '$DATA(^TMP($JOB))
DO VIEWHDR
WRITE !!,?15,"<Nothing to print>"
DO HOLD
GOTO EXIT
+3 SET STATION=0
FOR
SET STATION=$ORDER(^TMP($JOB,STATION))
if STATION=""
QUIT
DO VIEWHDR
Begin DoDot:1
+4 SET MAN("E")=0
SET (MOD,ESCAPE)=0
FOR
SET MAN("E")=$ORDER(^TMP($JOB,STATION,MAN("E")))
if MAN("E")=""
QUIT
SET MAN("PRNT")=$EXTRACT(MAN("E"),1,20)
FOR
SET MOD=$ORDER(^TMP($JOB,STATION,MAN("E"),MOD))
if MOD=""!(ESCAPE)
QUIT
SET MOD("E")=$EXTRACT(MOD,1,14)
Begin DoDot:2
+5 WRITE !,MAN("PRNT")_"~"_MOD("E"),?42
if 'ENSUP
WRITE $JUSTIFY(^TMP($JOB,STATION,MAN("E"),MOD,"FC"),5)
WRITE ?48,$JUSTIFY(^TMP($JOB,STATION,MAN("E"),MOD,"NC"),5),?54,$JUSTIFY(^("CC"),5)
+6 WRITE ?60
if 'ENSUP
WRITE $JUSTIFY(^TMP($JOB,STATION,MAN("E"),MOD,"NA"),5)
WRITE ?66,$JUSTIFY(^TMP($JOB,STATION,MAN("E"),MOD,0),5)
+7 SET TOTAL=0
FOR J=0,"FC","NC","CC","NA"
SET TOTAL=TOTAL+^TMP($JOB,STATION,MAN("E"),MOD,J)
+8 WRITE ?72,$JUSTIFY(TOTAL,5)
+9 KILL ^TMP($JOB,STATION,MAN("E"),MOD)
+10 SET LINE=LINE+1
IF (IOSL-LINE)'>4
DO HOLD
if ESCAPE
QUIT
if $DATA(^TMP($JOB))
DO VIEWHDR
End DoDot:2
+11 IF '$GET(ESCAPE)
Begin DoDot:2
+12 KILL X
SET $PIECE(X,"-",79)="-"
WRITE !,X
+13 WRITE !,"TOTALS",?42
if 'ENSUP
WRITE $JUSTIFY(TOTAL(STATION,"FC"),5)
WRITE ?48,$JUSTIFY(TOTAL(STATION,"NC"),5),?54,$JUSTIFY(TOTAL(STATION,"CC"),5),?60
if 'ENSUP
WRITE $JUSTIFY(TOTAL(STATION,"NA"),5)
WRITE ?66,$JUSTIFY(TOTAL(STATION,0),5),?72,$JUSTIFY(TOTAL(STATION,"GRAND"),5)
End DoDot:2
End DoDot:1
if '$GET(ESCAPE)
DO HOLD
if $GET(ESCAPE)
QUIT
WRITE @IOF
+14 GOTO EXIT
+15 ;
VIEWHDR ; header for Y2K snapshot
+1 if $EXTRACT(IOST,1,2)="C-"!(PAGE)
WRITE @IOF
SET PAGE=PAGE+1
SET LINE=3
+2 WRITE "Y2K Equipment Status - Counts Only Printed: "_DATE("PRNT")_" Page: "_PAGE
+3 IF ENSUP
WRITE !,"Equipment Records with Y2K Category of 'FC' or 'NA' are not being counted."
SET LINE=LINE+1
+4 WRITE !,"Manufacturer~Model "_$SELECT('ALLSTN:"(Consolidated: "_STATION("PARNT")_")",1:"(Station: "_STATION_")"),?45,"FC NC CC NA Null TOTAL"
+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,ALLSTN,ENSUP
+5 QUIT
+6 ;ENY2REP5