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

BLRCU.m

Go to the documentation of this file.
BLRCU ; IHS/HQT/MJL - CLEAN UP TRANSACTION LOG ; [ 04/09/2001  1:37 PM ]
 ;;5.2;LR;**1011**;MAY 01, 2001
 ;
TSK ;EP for task operation
 S U="^",BLRCANDS=$G(^BLRSITE($P(^AUTTSITE(1,0),U,1),0)),BLRSTOP=$P(BLRCANDS,U,9),BLRCANDS=$P(BLRCANDS,U,8)
 I BLRSTOP K %H,BLRCANDS,BLREDJ,BLREDT,BLRDJ,BLRHCNT,BLRKDJ,BLRKDT,BLRSITE,BLRSTOP,BLRTN,DA,DIK Q
 S:'BLRCANDS BLRCANDS=90
 S BLRSITE=0 F  S BLRSITE=$O(^BLRSITE(BLRSITE)) Q:'BLRSITE  D
 .S BLRKDJ=$H-1,BLREDJ=$P(^BLRSITE(BLRSITE,0),U,7)
 .S BLRDJ="" F  S BLRDJ=$O(^BLRSITE(BLRSITE,20,BLRDJ)) Q:BLRDJ=""  Q:BLRDJ=BLREDJ  Q:BLRDJ'<BLRKDJ  K ^BLRSITE(BLRSITE,20,BLRDJ)
 .S BLRKDJ=$H-BLRCANDS
 .S BLRDJ=BLRKDJ F  S BLRDJ=$O(^BLRSITE(BLRSITE,21,BLRDJ),-1) Q:BLRDJ=""  K ^BLRSITE(BLRSITE,21,BLRDJ)
 S %H=BLRKDJ D YMD^%DTC S BLRKDT=X,DIK="^BLRTXLOG("
 S BLRTN=0 F  S BLRTN=$O(^BLRTXLOG(BLRTN)) Q:'BLRTN  D
 .S BLREDT=$P($G(^BLRTXLOG(BLRTN,1)),U,3)
 .D:BLREDT<BLRKDT
 ..I BLREDT="" L +^BLRTXLOG(BLRTN):0 L -^BLRTXLOG(BLRTN) Q:'$T
 ..S DA=BLRTN D ^DIK
 I '$D(^BLRTXLOG(1)),$O(^BLRTXLOG(1))>10000 L +^BLRTXLOG("SEQ") S ^BLRTXLOG("SEQ")=0 L -^BLRTXLOG("SEQ")
 K %H,BLRCANDS,BLREDJ,BLREDT,BLRDJ,BLRHCNT,BLRKDJ,BLRKDT,BLRSITE,BLRSTOP,BLRTN,DA,DIK
 Q