ENPL5D ;(WIRMFO)/LKG,SAB-FYFP REPORT: PLAN SUMMARY PAGE ;5/15/96
;;7.0;ENGINEERING;**23,28**;Aug 17, 1993
PS N ENB,ENC,ENI,ENLD,ENLE,ENPR,ENX
S $P(ENLD," ",10)="",ENLE=ENLD
F ENI=1:1:6 S ENLD=ENLD_" --- ----------"
F ENI=1:1:6 S ENLE=ENLE_" === =========="
I ENFYB'="F" F ENYR=ENFY+ENFYB:1:ENFY+$S(ENFYE="F":5,1:ENFYE) D SUBTOT
I ENFYE="F" S ENYR="F" D SUBTOT
D HD
I ENFYB'="F" F ENYR=ENFY+ENFYB:1:ENFY+$S(ENFYE="F":5,1:ENFYE) D
. W:$E(IOST,1,2)'="C-" !
. W !,?5,"FY ",ENYR
. S ENX="ENT(ENYR," D LN
. I ENYR=ENFY W !,?5,ENLE,!
. I ENYR=(ENFY+$S(ENFYE="F":5,1:ENFYE)) D
. . W !,?5,ENLE,!,?5,"PLAN TOTAL" S ENX="ENB(" D LN W !
I ENFYE="F" S ENYR="F" D
. W:$E(IOST,1,2)'="C-" !
. W !,?5,"FY FUTURE"
. S ENX="ENT(ENYR," D LN
. W !,?5,ENLE,!,?5,"PLAN+FUTURE" S ENX="ENC(" D LN
D FT
Q
SUBTOT ; add program totals for year (ENYR) to FYFP subtotals
K ENT(ENYR,"C")
F ENPR="MA","MI","MM","NR","LE" D
. I "^MA^MI^MM^NR^"[(U_ENPR_U) D ; const year total
. . S $P(ENT(ENYR,"C"),U)=$P($G(ENT(ENYR,"C")),U)+$P($G(ENT(ENYR,ENPR)),U)
. . S $P(ENT(ENYR,"C"),U,2)=$P($G(ENT(ENYR,"C")),U,2)+$P($G(ENT(ENYR,ENPR)),U,2)
. Q:ENYR=ENFY
. ; plan+future total
. S $P(ENC(ENPR),U,1)=$P($G(ENC(ENPR)),U,1)+$P($G(ENT(ENYR,ENPR)),U,1)
. S $P(ENC(ENPR),U,2)=$P($G(ENC(ENPR)),U,2)+$P($G(ENT(ENYR,ENPR)),U,4)
. I "^MA^MI^MM^NR^"[(U_ENPR_U) D ; const plan+future total
. . S $P(ENC("C"),U,1)=$P($G(ENC("C")),U,1)+$P($G(ENT(ENYR,ENPR)),U,1)
. . S $P(ENC("C"),U,2)=$P($G(ENC("C")),U,2)+$P($G(ENT(ENYR,ENPR)),U,4)
. Q:ENYR="F"
. ; plan total
. S $P(ENB(ENPR),U,1)=$P($G(ENB(ENPR)),U,1)+$P($G(ENT(ENYR,ENPR)),U,1)
. S $P(ENB(ENPR),U,2)=$P($G(ENB(ENPR)),U,2)+$P($G(ENT(ENYR,ENPR)),U,3)
. I "^MA^MI^MM^NR^"[(U_ENPR_U) D ; const plan total
. . S $P(ENB("C"),U,1)=$P($G(ENB("C")),U,1)+$P($G(ENT(ENYR,ENPR)),U,1)
. . S $P(ENB("C"),U,2)=$P($G(ENB("C")),U,2)+$P($G(ENT(ENYR,ENPR)),U,3)
Q
LN ; cost line for ENX array
W ?18,$J($P($G(@(ENX_"""MA"")")),U,2)+0,3)
W ?23,"$",$J($FN($P($G(@(ENX_"""MA"")")),U),","),9)
W ?37,$J($P($G(@(ENX_"""MI"")")),U,2)+0,3)
W ?42,"$",$J($FN($P($G(@(ENX_"""MI"")")),U),","),9)
W ?56,$J($P($G(@(ENX_"""MM"")")),U,2)+0,3)
W ?61,"$",$J($FN($P($G(@(ENX_"""MM"")")),U),","),9)
W ?75,$J($P($G(@(ENX_"""NR"")")),U,2)+0,3)
W ?80,"$",$J($FN($P($G(@(ENX_"""NR"")")),U),","),9)
W ?94,$J($P($G(@(ENX_"""C"")")),U,2)+0,3)
W ?99,"$",$J($FN($P($G(@(ENX_"""C"")")),U),","),9)
W ?113,$J($P($G(@(ENX_"""LE"")")),U,2)+0,3)
W ?118,"$",$J($FN($P($G(@(ENX_"""LE"")")),U),","),9)
Q
HD ; page header
D FYFPHD^ENPL5A
W !,?42,"PLAN SUMMARY BY PROGRAMS AND FISCAL YEARS (in $000)"
W:$E(IOST,1,2)'="C-" !
W !,?23,"MAJOR",?42,"MINOR",?58,"MINOR MISC",?81,"NRM"
W ?96,"CONST TOTAL",?115,"LEASE TOTAL"
W !,?18,"CNT",?26,"COST",?37,"CNT",?45,"COST",?56,"CNT",?64,"COST"
W ?75,"CNT",?83,"COST",?94,"CNT",?102,"COST",?113,"CNT",?121,"COST"
W !,?5,ENLD
Q
FT ; page footer
W:$E(IOST,1,2)'="C-" !!!!!,?5,"________________________"
;F ENI=$Y+9:1:IOSL W !
F ENI=$Y+9:1:$S(IOSL>254:$Y+12,1:IOSL) W ! ; for long page length
W !,?5,"PLAN and PLAN+FUTURE counts only include split year projects once and may not equal the sum of the year counts."
W !,?5,"Lease column excludes Expedited leases."
W:$E(IOST,1,2)'="C-" !
S ENPG=ENPG+1 W !,?64,"Page ",ENPG,?100,ENRDT
I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR S:'Y END=1
Q
SUM ; add a project to year-program totals
N ENFYAE,ENFYCO
; input variables
; ENYR year
; ENPR program
; ENFY current year of 5-Yr Plan
; ENCST oost in thousands
; ENT( (optional) current totals
; for MA,MI,MM,NR programs
; ENAE true if funding year A/E in ENYR
; ENCO true if funding year Const in ENYR
; output variables
; ENT(ENYR,ENPR array modified
S $P(ENT(ENYR,ENPR),U)=$P($G(ENT(ENYR,ENPR)),U)+ENCST ; cost
S $P(ENT(ENYR,ENPR),U,2)=$P($G(ENT(ENYR,ENPR)),U,2)+1 ; cnt
S $P(ENT(ENYR,ENPR),U,3)=$P($G(ENT(ENYR,ENPR)),U,3)+1 ; plan cnt
S $P(ENT(ENYR,ENPR),U,4)=$P($G(ENT(ENYR,ENPR)),U,4)+1 ; plan+future cnt
Q:"^MA^MI^MM^NR^"'[(U_ENPR_U) ; only check const. proj for split year
S ENFYAE=$P($G(^ENG("PROJ",ENDA,5)),U,7)
S ENFYCO=$P($G(^ENG("PROJ",ENDA,0)),U,7)
I ENFYAE]"",ENFYCO]"",'(ENAE&ENCO) D ; split year adjustments
. I ENFYAE'<(ENFY+$S(ENFYB="F":6,ENFYB=0:1,1:ENFYB)),ENFYAE'>(ENFY+$S(ENFYE="F":5,1:ENFYE)),ENFYCO'<(ENFY+$S(ENFYB="F":6,ENFYB=0:1,1:ENFYB)),ENFYCO'>(ENFY+$S(ENFYE="F":5,1:ENFYE)) D Q
. . ; both in plan range (adjust count)
. . S $P(ENT(ENYR,ENPR),U,3)=$P($G(ENT(ENYR,ENPR)),U,3)-.5
. . S $P(ENT(ENYR,ENPR),U,4)=$P($G(ENT(ENYR,ENPR)),U,4)-.5
. I ENFYAE>(ENFY+5)!(ENFYCO>(ENFY+5)),(ENFYAE'<(ENFY+$S(ENFYB="F":6,ENFYB=0:1,1:ENFYB))&(ENFYAE'>(ENFY+$S(ENFYE="F":5,1:ENFYE))))!(ENFYCO'<(ENFY+$S(ENFYB="F":6,ENFYB=0:1,1:ENFYB))&(ENFYCO'>(ENFY+$S(ENFYE="F":5,1:ENFYE)))) D Q
. . ; one in future years and one in plan range (adjust count)
. . S $P(ENT(ENYR,ENPR),U,4)=$P($G(ENT(ENYR,ENPR)),U,4)-.5
Q
;ENPL5D
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENPL5D 5053 printed Dec 13, 2024@01:54:48 Page 2
ENPL5D ;(WIRMFO)/LKG,SAB-FYFP REPORT: PLAN SUMMARY PAGE ;5/15/96
+1 ;;7.0;ENGINEERING;**23,28**;Aug 17, 1993
PS NEW ENB,ENC,ENI,ENLD,ENLE,ENPR,ENX
+1 SET $PIECE(ENLD," ",10)=""
SET ENLE=ENLD
+2 FOR ENI=1:1:6
SET ENLD=ENLD_" --- ----------"
+3 FOR ENI=1:1:6
SET ENLE=ENLE_" === =========="
+4 IF ENFYB'="F"
FOR ENYR=ENFY+ENFYB:1:ENFY+$SELECT(ENFYE="F":5,1:ENFYE)
DO SUBTOT
+5 IF ENFYE="F"
SET ENYR="F"
DO SUBTOT
+6 DO HD
+7 IF ENFYB'="F"
FOR ENYR=ENFY+ENFYB:1:ENFY+$SELECT(ENFYE="F":5,1:ENFYE)
Begin DoDot:1
+8 if $EXTRACT(IOST,1,2)'="C-"
WRITE !
+9 WRITE !,?5,"FY ",ENYR
+10 SET ENX="ENT(ENYR,"
DO LN
+11 IF ENYR=ENFY
WRITE !,?5,ENLE,!
+12 IF ENYR=(ENFY+$SELECT(ENFYE="F":5,1:ENFYE))
Begin DoDot:2
+13 WRITE !,?5,ENLE,!,?5,"PLAN TOTAL"
SET ENX="ENB("
DO LN
WRITE !
End DoDot:2
End DoDot:1
+14 IF ENFYE="F"
SET ENYR="F"
Begin DoDot:1
+15 if $EXTRACT(IOST,1,2)'="C-"
WRITE !
+16 WRITE !,?5,"FY FUTURE"
+17 SET ENX="ENT(ENYR,"
DO LN
+18 WRITE !,?5,ENLE,!,?5,"PLAN+FUTURE"
SET ENX="ENC("
DO LN
End DoDot:1
+19 DO FT
+20 QUIT
SUBTOT ; add program totals for year (ENYR) to FYFP subtotals
+1 KILL ENT(ENYR,"C")
+2 FOR ENPR="MA","MI","MM","NR","LE"
Begin DoDot:1
+3 ; const year total
IF "^MA^MI^MM^NR^"[(U_ENPR_U)
Begin DoDot:2
+4 SET $PIECE(ENT(ENYR,"C"),U)=$PIECE($GET(ENT(ENYR,"C")),U)+$PIECE($GET(ENT(ENYR,ENPR)),U)
+5 SET $PIECE(ENT(ENYR,"C"),U,2)=$PIECE($GET(ENT(ENYR,"C")),U,2)+$PIECE($GET(ENT(ENYR,ENPR)),U,2)
End DoDot:2
+6 if ENYR=ENFY
QUIT
+7 ; plan+future total
+8 SET $PIECE(ENC(ENPR),U,1)=$PIECE($GET(ENC(ENPR)),U,1)+$PIECE($GET(ENT(ENYR,ENPR)),U,1)
+9 SET $PIECE(ENC(ENPR),U,2)=$PIECE($GET(ENC(ENPR)),U,2)+$PIECE($GET(ENT(ENYR,ENPR)),U,4)
+10 ; const plan+future total
IF "^MA^MI^MM^NR^"[(U_ENPR_U)
Begin DoDot:2
+11 SET $PIECE(ENC("C"),U,1)=$PIECE($GET(ENC("C")),U,1)+$PIECE($GET(ENT(ENYR,ENPR)),U,1)
+12 SET $PIECE(ENC("C"),U,2)=$PIECE($GET(ENC("C")),U,2)+$PIECE($GET(ENT(ENYR,ENPR)),U,4)
End DoDot:2
+13 if ENYR="F"
QUIT
+14 ; plan total
+15 SET $PIECE(ENB(ENPR),U,1)=$PIECE($GET(ENB(ENPR)),U,1)+$PIECE($GET(ENT(ENYR,ENPR)),U,1)
+16 SET $PIECE(ENB(ENPR),U,2)=$PIECE($GET(ENB(ENPR)),U,2)+$PIECE($GET(ENT(ENYR,ENPR)),U,3)
+17 ; const plan total
IF "^MA^MI^MM^NR^"[(U_ENPR_U)
Begin DoDot:2
+18 SET $PIECE(ENB("C"),U,1)=$PIECE($GET(ENB("C")),U,1)+$PIECE($GET(ENT(ENYR,ENPR)),U,1)
+19 SET $PIECE(ENB("C"),U,2)=$PIECE($GET(ENB("C")),U,2)+$PIECE($GET(ENT(ENYR,ENPR)),U,3)
End DoDot:2
End DoDot:1
+20 QUIT
LN ; cost line for ENX array
+1 WRITE ?18,$JUSTIFY($PIECE($GET(@(ENX_"""MA"")")),U,2)+0,3)
+2 WRITE ?23,"$",$JUSTIFY($FNUMBER($PIECE($GET(@(ENX_"""MA"")")),U),","),9)
+3 WRITE ?37,$JUSTIFY($PIECE($GET(@(ENX_"""MI"")")),U,2)+0,3)
+4 WRITE ?42,"$",$JUSTIFY($FNUMBER($PIECE($GET(@(ENX_"""MI"")")),U),","),9)
+5 WRITE ?56,$JUSTIFY($PIECE($GET(@(ENX_"""MM"")")),U,2)+0,3)
+6 WRITE ?61,"$",$JUSTIFY($FNUMBER($PIECE($GET(@(ENX_"""MM"")")),U),","),9)
+7 WRITE ?75,$JUSTIFY($PIECE($GET(@(ENX_"""NR"")")),U,2)+0,3)
+8 WRITE ?80,"$",$JUSTIFY($FNUMBER($PIECE($GET(@(ENX_"""NR"")")),U),","),9)
+9 WRITE ?94,$JUSTIFY($PIECE($GET(@(ENX_"""C"")")),U,2)+0,3)
+10 WRITE ?99,"$",$JUSTIFY($FNUMBER($PIECE($GET(@(ENX_"""C"")")),U),","),9)
+11 WRITE ?113,$JUSTIFY($PIECE($GET(@(ENX_"""LE"")")),U,2)+0,3)
+12 WRITE ?118,"$",$JUSTIFY($FNUMBER($PIECE($GET(@(ENX_"""LE"")")),U),","),9)
+13 QUIT
HD ; page header
+1 DO FYFPHD^ENPL5A
+2 WRITE !,?42,"PLAN SUMMARY BY PROGRAMS AND FISCAL YEARS (in $000)"
+3 if $EXTRACT(IOST,1,2)'="C-"
WRITE !
+4 WRITE !,?23,"MAJOR",?42,"MINOR",?58,"MINOR MISC",?81,"NRM"
+5 WRITE ?96,"CONST TOTAL",?115,"LEASE TOTAL"
+6 WRITE !,?18,"CNT",?26,"COST",?37,"CNT",?45,"COST",?56,"CNT",?64,"COST"
+7 WRITE ?75,"CNT",?83,"COST",?94,"CNT",?102,"COST",?113,"CNT",?121,"COST"
+8 WRITE !,?5,ENLD
+9 QUIT
FT ; page footer
+1 if $EXTRACT(IOST,1,2)'="C-"
WRITE !!!!!,?5,"________________________"
+2 ;F ENI=$Y+9:1:IOSL W !
+3 ; for long page length
FOR ENI=$Y+9:1:$SELECT(IOSL>254:$Y+12,1:IOSL)
WRITE !
+4 WRITE !,?5,"PLAN and PLAN+FUTURE counts only include split year projects once and may not equal the sum of the year counts."
+5 WRITE !,?5,"Lease column excludes Expedited leases."
+6 if $EXTRACT(IOST,1,2)'="C-"
WRITE !
+7 SET ENPG=ENPG+1
WRITE !,?64,"Page ",ENPG,?100,ENRDT
+8 IF $EXTRACT(IOST,1,2)="C-"
SET DIR(0)="E"
DO ^DIR
KILL DIR
if 'Y
SET END=1
+9 QUIT
SUM ; add a project to year-program totals
+1 NEW ENFYAE,ENFYCO
+2 ; input variables
+3 ; ENYR year
+4 ; ENPR program
+5 ; ENFY current year of 5-Yr Plan
+6 ; ENCST oost in thousands
+7 ; ENT( (optional) current totals
+8 ; for MA,MI,MM,NR programs
+9 ; ENAE true if funding year A/E in ENYR
+10 ; ENCO true if funding year Const in ENYR
+11 ; output variables
+12 ; ENT(ENYR,ENPR array modified
+13 ; cost
SET $PIECE(ENT(ENYR,ENPR),U)=$PIECE($GET(ENT(ENYR,ENPR)),U)+ENCST
+14 ; cnt
SET $PIECE(ENT(ENYR,ENPR),U,2)=$PIECE($GET(ENT(ENYR,ENPR)),U,2)+1
+15 ; plan cnt
SET $PIECE(ENT(ENYR,ENPR),U,3)=$PIECE($GET(ENT(ENYR,ENPR)),U,3)+1
+16 ; plan+future cnt
SET $PIECE(ENT(ENYR,ENPR),U,4)=$PIECE($GET(ENT(ENYR,ENPR)),U,4)+1
+17 ; only check const. proj for split year
if "^MA^MI^MM^NR^"'[(U_ENPR_U)
QUIT
+18 SET ENFYAE=$PIECE($GET(^ENG("PROJ",ENDA,5)),U,7)
+19 SET ENFYCO=$PIECE($GET(^ENG("PROJ",ENDA,0)),U,7)
+20 ; split year adjustments
IF ENFYAE]""
IF ENFYCO]""
IF '(ENAE&ENCO)
Begin DoDot:1
+21 IF ENFYAE'<(ENFY+$SELECT(ENFYB="F":6,ENFYB=0:1,1:ENFYB))
IF ENFYAE'>(ENFY+$SELECT(ENFYE="F":5,1:ENFYE))
IF ENFYCO'<(ENFY+$SELECT(ENFYB="F":6,ENFYB=0:1,1:ENFYB))
IF ENFYCO'>(ENFY+$SELECT(ENFYE="F":5,1:ENFYE))
Begin DoDot:2
+22 ; both in plan range (adjust count)
+23 SET $PIECE(ENT(ENYR,ENPR),U,3)=$PIECE($GET(ENT(ENYR,ENPR)),U,3)-.5
+24 SET $PIECE(ENT(ENYR,ENPR),U,4)=$PIECE($GET(ENT(ENYR,ENPR)),U,4)-.5
End DoDot:2
QUIT
+25 IF ENFYAE>(ENFY+5)!(ENFYCO>(ENFY+5))
IF (ENFYAE'<(ENFY+$SELECT(ENFYB="F":6,ENFYB=0:1,1:ENFYB))&(ENFYAE'>(ENFY+$SELECT(ENFYE="F":5,1:ENFYE))))!(ENFYCO'<(ENFY+$SELECT(ENFYB="F":6,ENFYB=0:1,1:ENFYB))&(ENFYCO'>(ENFY+$SELECT(ENFYE="F":5,1:ENFYE))))
Begin DoDot:2
+26 ; one in future years and one in plan range (adjust count)
+27 SET $PIECE(ENT(ENYR,ENPR),U,4)=$PIECE($GET(ENT(ENYR,ENPR)),U,4)-.5
End DoDot:2
QUIT
End DoDot:1
+28 QUIT
+29 ;ENPL5D