PRCUPM ;WISC@ALTOONA/CTB/WISC/PLT-IFCAP GENERAL BATCH PROCESS ; 06 Apr 93 12:03 PM
V ;;5.0;IFCAP;;4/21/95
;THIS ROUTINE SHOULD BE TASKED TO RUN DAILY AT WHATEVER TIME
;THE IRM STAFF FEELS IS APPROPRIATE. IT SHOULD BE RESCHEDULED
;TO RUN DAILY. ITS JOB IS TO SPAWN THE APPROPRIATE NUMBER OF
;'KILLER' JOBS (^PRCUPMK) AS SPECIFIED IN FILE 443.2.
;
;IF LEFTOVER INPROCESS JOBS REMAIN IN FILE 443.3, AND THEY ARE OVER
; 1 DAY OLD, THEY WILL BE ADDED TO FILE 443.1 HERE
I $O(^PRC(443.3,0)) DO
. NEW DA,TODAY,NODE,NODE1,ROU,VARIABLE,MSG
. S TODAY=+$H,DA=0
. F S DA=$O(^PRC(443.3,DA)) Q:'DA DO
. . S NODE=$G(^PRC(443.3,DA,0)) I NODE="" D REMIP^PRCUPM1(DA) QUIT
. . S NODE1=$G(^PRC(443.3,DA,1)) I NODE1="" D REMIP^PRCUPM1(DA) QUIT
. . S ROU=$P(NODE,2,3),VARIABLE=$P(NODE,4) I ROU="" D REMIP^PRCUPM1(DA) QUIT
. . S DATE=+NODE1 Q:TODAY'>DATE
. . D ADD^PRCUPM1(ROU,VARIABLE,.MSG)
. . I 'MSG D REMIP^PRCUPM1(DA)
. . QUIT
. QUIT
;IT WILL NOT SPAWN 'KILLER' JOBS IF THERE ARE NO ENTRIES IN
;FILE 443.1
I $O(^PRC(443.1,0))="" W !!,"GENERAL BATCH PROCESS STARTED, NO NEW ENTRIES FOUND IN FILE 443.1. CHECK IN PROCESSING FILE 443.3."
S PARAM=^PRC(443.2,1,0)_"^"_$H
S STOP=$P(PARAM,"^",3),SAT=$P(PARAM,"^",4),SUN=$P(PARAM,"^",5),HOL=$P(PARAM,"^",6),START=$P(PARAM,"^",8),NUMJOB=$P(PARAM,"^",7)
S:+NUMJOB=0 NUMJOB=1
S X=DT_"."_STOP D H^%DTC S STOP=%T
I STOP<$P(START,",",2) S STOP=$P(START,",",1)+1_","_STOP
E S STOP=$P(START,",",1)_","_$P(STOP,",",2)
S %H=STOP D YMD^%DTC
D NOW^%DTC
I ((SAT&(Y=6))!(SUN&(Y=7))!(HOL&($D(^HOLIDAY(X))))) S $P(STOP,",",2)=$P(START,",",2)
F ZII=1:1:NUMJOB D
. S ZTRTN="PRCUPMK",ZTDESC="IFCAP General Batch Process",ZTIO="",ZTDTH=$H
. S ZTSAVE("STOP")="",ZTKIL=$H+2_",0"
. D ^%ZTLOAD W !,ZTSK,!
. QUIT
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCUPM 1800 printed Nov 22, 2024@17:29:51 Page 2
PRCUPM ;WISC@ALTOONA/CTB/WISC/PLT-IFCAP GENERAL BATCH PROCESS ; 06 Apr 93 12:03 PM
V ;;5.0;IFCAP;;4/21/95
+1 ;THIS ROUTINE SHOULD BE TASKED TO RUN DAILY AT WHATEVER TIME
+2 ;THE IRM STAFF FEELS IS APPROPRIATE. IT SHOULD BE RESCHEDULED
+3 ;TO RUN DAILY. ITS JOB IS TO SPAWN THE APPROPRIATE NUMBER OF
+4 ;'KILLER' JOBS (^PRCUPMK) AS SPECIFIED IN FILE 443.2.
+5 ;
+6 ;IF LEFTOVER INPROCESS JOBS REMAIN IN FILE 443.3, AND THEY ARE OVER
+7 ; 1 DAY OLD, THEY WILL BE ADDED TO FILE 443.1 HERE
+8 IF $ORDER(^PRC(443.3,0))
Begin DoDot:1
+9 NEW DA,TODAY,NODE,NODE1,ROU,VARIABLE,MSG
+10 SET TODAY=+$HOROLOG
SET DA=0
+11 FOR
SET DA=$ORDER(^PRC(443.3,DA))
if 'DA
QUIT
Begin DoDot:2
+12 SET NODE=$GET(^PRC(443.3,DA,0))
IF NODE=""
DO REMIP^PRCUPM1(DA)
QUIT
+13 SET NODE1=$GET(^PRC(443.3,DA,1))
IF NODE1=""
DO REMIP^PRCUPM1(DA)
QUIT
+14 SET ROU=$PIECE(NODE,2,3)
SET VARIABLE=$PIECE(NODE,4)
IF ROU=""
DO REMIP^PRCUPM1(DA)
QUIT
+15 SET DATE=+NODE1
if TODAY'>DATE
QUIT
+16 DO ADD^PRCUPM1(ROU,VARIABLE,.MSG)
+17 IF 'MSG
DO REMIP^PRCUPM1(DA)
+18 QUIT
End DoDot:2
+19 QUIT
End DoDot:1
+20 ;IT WILL NOT SPAWN 'KILLER' JOBS IF THERE ARE NO ENTRIES IN
+21 ;FILE 443.1
+22 IF $ORDER(^PRC(443.1,0))=""
WRITE !!,"GENERAL BATCH PROCESS STARTED, NO NEW ENTRIES FOUND IN FILE 443.1. CHECK IN PROCESSING FILE 443.3."
+23 SET PARAM=^PRC(443.2,1,0)_"^"_$HOROLOG
+24 SET STOP=$PIECE(PARAM,"^",3)
SET SAT=$PIECE(PARAM,"^",4)
SET SUN=$PIECE(PARAM,"^",5)
SET HOL=$PIECE(PARAM,"^",6)
SET START=$PIECE(PARAM,"^",8)
SET NUMJOB=$PIECE(PARAM,"^",7)
+25 if +NUMJOB=0
SET NUMJOB=1
+26 SET X=DT_"."_STOP
DO H^%DTC
SET STOP=%T
+27 IF STOP<$PIECE(START,",",2)
SET STOP=$PIECE(START,",",1)+1_","_STOP
+28 IF '$TEST
SET STOP=$PIECE(START,",",1)_","_$PIECE(STOP,",",2)
+29 SET %H=STOP
DO YMD^%DTC
+30 DO NOW^%DTC
+31 IF ((SAT&(Y=6))!(SUN&(Y=7))!(HOL&($DATA(^HOLIDAY(X)))))
SET $PIECE(STOP,",",2)=$PIECE(START,",",2)
+32 FOR ZII=1:1:NUMJOB
Begin DoDot:1
+33 SET ZTRTN="PRCUPMK"
SET ZTDESC="IFCAP General Batch Process"
SET ZTIO=""
SET ZTDTH=$HOROLOG
+34 SET ZTSAVE("STOP")=""
SET ZTKIL=$HOROLOG+2_",0"
+35 DO ^%ZTLOAD
WRITE !,ZTSK,!
+36 QUIT
End DoDot:1
+37 QUIT