Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PRCUPM

PRCUPM.m

Go to the documentation of this file.
  1. PRCUPM ;WISC@ALTOONA/CTB/WISC/PLT-IFCAP GENERAL BATCH PROCESS ; 06 Apr 93 12:03 PM
  1. V ;;5.0;IFCAP;;4/21/95
  1. ;THIS ROUTINE SHOULD BE TASKED TO RUN DAILY AT WHATEVER TIME
  1. ;THE IRM STAFF FEELS IS APPROPRIATE. IT SHOULD BE RESCHEDULED
  1. ;TO RUN DAILY. ITS JOB IS TO SPAWN THE APPROPRIATE NUMBER OF
  1. ;'KILLER' JOBS (^PRCUPMK) AS SPECIFIED IN FILE 443.2.
  1. ;
  1. ;IF LEFTOVER INPROCESS JOBS REMAIN IN FILE 443.3, AND THEY ARE OVER
  1. ; 1 DAY OLD, THEY WILL BE ADDED TO FILE 443.1 HERE
  1. I $O(^PRC(443.3,0)) DO
  1. . NEW DA,TODAY,NODE,NODE1,ROU,VARIABLE,MSG
  1. . S TODAY=+$H,DA=0
  1. . F S DA=$O(^PRC(443.3,DA)) Q:'DA DO
  1. . . S NODE=$G(^PRC(443.3,DA,0)) I NODE="" D REMIP^PRCUPM1(DA) QUIT
  1. . . S NODE1=$G(^PRC(443.3,DA,1)) I NODE1="" D REMIP^PRCUPM1(DA) QUIT
  1. . . S ROU=$P(NODE,2,3),VARIABLE=$P(NODE,4) I ROU="" D REMIP^PRCUPM1(DA) QUIT
  1. . . S DATE=+NODE1 Q:TODAY'>DATE
  1. . . D ADD^PRCUPM1(ROU,VARIABLE,.MSG)
  1. . . I 'MSG D REMIP^PRCUPM1(DA)
  1. . . QUIT
  1. . QUIT
  1. ;IT WILL NOT SPAWN 'KILLER' JOBS IF THERE ARE NO ENTRIES IN
  1. ;FILE 443.1
  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."
  1. S PARAM=^PRC(443.2,1,0)_"^"_$H
  1. 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)
  1. S:+NUMJOB=0 NUMJOB=1
  1. S X=DT_"."_STOP D H^%DTC S STOP=%T
  1. I STOP<$P(START,",",2) S STOP=$P(START,",",1)+1_","_STOP
  1. E S STOP=$P(START,",",1)_","_$P(STOP,",",2)
  1. S %H=STOP D YMD^%DTC
  1. D NOW^%DTC
  1. I ((SAT&(Y=6))!(SUN&(Y=7))!(HOL&($D(^HOLIDAY(X))))) S $P(STOP,",",2)=$P(START,",",2)
  1. F ZII=1:1:NUMJOB D
  1. . S ZTRTN="PRCUPMK",ZTDESC="IFCAP General Batch Process",ZTIO="",ZTDTH=$H
  1. . S ZTSAVE("STOP")="",ZTKIL=$H+2_",0"
  1. . D ^%ZTLOAD W !,ZTSK,!
  1. . QUIT
  1. Q