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

AZQZTMK.m

Go to the documentation of this file.
AZQZTMK ;IHS/MFD ;NON-INTERACTIVE KILL OFF TM QUEUE ; 12/16/88  5:38 PM
 ;SCHEDULE WITH TASKMAN TO AUTOMATICALLY CLEAN %ZTSK GLOBAL
 ;SET ZTKF TO NUMBER OF DAYS BACK TO SAVE
 S ZTKF=1,U="^"
DQ S DS="" F I=0:0 S DS=$O(^%ZTSCH(DS)) Q:DS=""  S ZTSK="" F J=0:0 S ZTSK=$O(^%ZTSCH(DS,ZTSK)) Q:ZTSK=""  I $D(^%ZTSK(ZTSK,0)) S $P(^(0),U,6)=DS
 ;
 S ZTSN=0,ZTMX=^%ZTSK(0)-10,ZTDT=$H-ZTKF
A1 S ZTSN=$N(^%ZTSK(ZTSN)) G END:ZTSN'?1N.N
 I ZTSN>ZTMX S ZTSN=100+^%ZTSK(0),ZTMX=9999999999 G A1
 L ^%ZTSK S X=$S($D(^%ZTSK(ZTSN,0)):^(0),1:"") L
 S DL=+$P(X,"^",5),DR=+$P(X,"^",6),DC=+$P(X,"^",7),DS=+$P(X,"^",8)
 I DS G A1:+$H<DS,A2
 S:'DC DC=DR S:'DC DC=DL G A1:DC>ZTDT
A2 K ^%ZTSK(ZTSN) G A1
END I ^%ZTSK(0)>99999999 L ^%ZTSK S ^%ZTSK(0)=1000 L
KIL K ZTSK,ZTSN,ZTKF,ZTMX,ZTDT,DL,DR,DC,DS
 Q