source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCUPM.m@ 642

Last change on this file since 642 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.7 KB
Line 
1PRCUPM ;WISC@ALTOONA/CTB/WISC/PLT-IFCAP GENERAL BATCH PROCESS ; 06 Apr 93 12:03 PM
2V ;;5.0;IFCAP;;4/21/95
3 ;THIS ROUTINE SHOULD BE TASKED TO RUN DAILY AT WHATEVER TIME
4 ;THE IRM STAFF FEELS IS APPROPRIATE. IT SHOULD BE RESCHEDULED
5 ;TO RUN DAILY. ITS JOB IS TO SPAWN THE APPROPRIATE NUMBER OF
6 ;'KILLER' JOBS (^PRCUPMK) AS SPECIFIED IN FILE 443.2.
7 ;
8 ;IF LEFTOVER INPROCESS JOBS REMAIN IN FILE 443.3, AND THEY ARE OVER
9 ; 1 DAY OLD, THEY WILL BE ADDED TO FILE 443.1 HERE
10 I $O(^PRC(443.3,0)) DO
11 . NEW DA,TODAY,NODE,NODE1,ROU,VARIABLE,MSG
12 . S TODAY=+$H,DA=0
13 . F S DA=$O(^PRC(443.3,DA)) Q:'DA DO
14 . . S NODE=$G(^PRC(443.3,DA,0)) I NODE="" D REMIP^PRCUPM1(DA) QUIT
15 . . S NODE1=$G(^PRC(443.3,DA,1)) I NODE1="" D REMIP^PRCUPM1(DA) QUIT
16 . . S ROU=$P(NODE,2,3),VARIABLE=$P(NODE,4) I ROU="" D REMIP^PRCUPM1(DA) QUIT
17 . . S DATE=+NODE1 Q:TODAY'>DATE
18 . . D ADD^PRCUPM1(ROU,VARIABLE,.MSG)
19 . . I 'MSG D REMIP^PRCUPM1(DA)
20 . . QUIT
21 . QUIT
22 ;IT WILL NOT SPAWN 'KILLER' JOBS IF THERE ARE NO ENTRIES IN
23 ;FILE 443.1
24 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."
25 S PARAM=^PRC(443.2,1,0)_"^"_$H
26 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)
27 S:+NUMJOB=0 NUMJOB=1
28 S X=DT_"."_STOP D H^%DTC S STOP=%T
29 I STOP<$P(START,",",2) S STOP=$P(START,",",1)+1_","_STOP
30 E S STOP=$P(START,",",1)_","_$P(STOP,",",2)
31 S %H=STOP D YMD^%DTC
32 D NOW^%DTC
33 I ((SAT&(Y=6))!(SUN&(Y=7))!(HOL&($D(^HOLIDAY(X))))) S $P(STOP,",",2)=$P(START,",",2)
34 F ZII=1:1:NUMJOB D
35 . S ZTRTN="PRCUPMK",ZTDESC="IFCAP General Batch Process",ZTIO="",ZTDTH=$H
36 . S ZTSAVE("STOP")="",ZTKIL=$H+2_",0"
37 . D ^%ZTLOAD W !,ZTSK,!
38 . QUIT
39 Q
Note: See TracBrowser for help on using the repository browser.