LRTASK ;SLC/RWF- QUEUE A TASK TO RUN ; 2/24/87 8:17 PM ;
;;V~4.08~
;CALL WITH LRPGM, LRTIME, LRIO WILL RETURN ZTSK
;IF LRTIME=0 THEN ^%ZTSCH(LRTIME,ZTSK)=LRIO WILL NOT BE SET
SET S U="^" X ^%ZOSF("UCI")
TSK L ^%ZTSK(0) S (^%ZTSK(0),ZTSK)=^%ZTSK(0)+1 G TSK:$D(^%ZTSK(ZTSK))
S ^%ZTSK(ZTSK,0)=LRPGM_U_DUZ_U_Y_U_$H_U_LRTIME_U
LOCK I LRTIME S ^%ZTSCH(LRTIME,ZTSK)=LRIO K LRIO,LRTIME
K LRPGM Q
SAVE ;WILL SAVE LOCAL SYMBOL TABLE IN ^%ZTSK(ZTSK,
I '$D(ZTSK) S:'$D(LRTIME) LRTIME=0 D LRTASK
K IO,IOM,IOST,IOF,IOSL
S X="^%ZTSK("_ZTSK_"," X ^DD("OS",^DD("OS"),8)
Q
LOAD ;from LROC
S Y="%" F Z=0:0 S Y=$N(^%ZTSK(ZTSK,Y)),%=$D(^(Y)) Q:'% S:%#2 @(Y_"=^(Y)") I %>9 S %X="^%ZTSK(ZTSK,Y,",%Y=Y_"(" D %XY^%RCR
Q
DEV W ! S %IS="NMQ",IOP="Q" D ^%ZIS K %IS,IOP Q:POP S LRIOZERO=IO(0)
S LRIO=ION,LRTIME=0 D LRTASK,SAVE,TIME S ^%ZTSCH(LRTIME,ZTSK)=LRIO K ZTSK,LRIOZERO
Q
TIME S %DT="AET",%DT("A")="TIME TO RUN: T+1@1AM//" D ^%DT K %DT G:X="^" H^XUS I Y=-1 S LRTIME=$H+1_",3600" Q
S X=Y,LRTIME=$P(Y,".",2)_"0000" D H^%DTC S LRTIME=%H_","_($E(LRTIME,1,2)*3600+($E(LRTIME,3,4)*60))
Q
WAIT W ! S IOP="Q",%IS="QN" D ^%ZIS Q:POP
S LRTIME=0,LRIO=ION D LRTASK,TIME Q
LRTASK ;SLC/RWF- QUEUE A TASK TO RUN ; 2/24/87 8:17 PM ;
+1 ;;V~4.08~
+2 ;CALL WITH LRPGM, LRTIME, LRIO WILL RETURN ZTSK
+3 ;IF LRTIME=0 THEN ^%ZTSCH(LRTIME,ZTSK)=LRIO WILL NOT BE SET
SET SET U="^"
XECUTE ^%ZOSF("UCI")
TSK LOCK ^%ZTSK(0)
SET (^%ZTSK(0),ZTSK)=^%ZTSK(0)+1
IF $DATA(^%ZTSK(ZTSK))
GOTO TSK
+1 SET ^%ZTSK(ZTSK,0)=LRPGM_U_DUZ_U_Y_U_$HOROLOG_U_LRTIME_U
+2 LOCK
IF LRTIME
SET ^%ZTSCH(LRTIME,ZTSK)=LRIO
KILL LRIO,LRTIME
+3 KILL LRPGM
QUIT
SAVE ;WILL SAVE LOCAL SYMBOL TABLE IN ^%ZTSK(ZTSK,
+1 IF '$DATA(ZTSK)
IF '$DATA(LRTIME)
SET LRTIME=0
DO LRTASK
+2 KILL IO,IOM,IOST,IOF,IOSL
+3 SET X="^%ZTSK("_ZTSK_","
XECUTE ^DD("OS",^DD("OS"),8)
+4 QUIT
LOAD ;from LROC
+1 SET Y="%"
FOR Z=0:0