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

LRTASK.m

Go to the documentation of this file.
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