COMPILE ROUTINE FIX_REACT_UTIL(Dummy)
ROWDEF(CHARSTR)

DECLARE SUBROUTINE obj_Schedule,Send_Dyn,Send_Info
DECLARE FUNCTION Get_Status, Set_Printer

$INSERT OIPRINT_EQUATES

$INSERT REACT_UTIL


OPEN 'REACT_UTIL' To FileIn ELSE GOTO Bail

SELECT FileIn

GOTO Skip

Done = 0
RecCnt = 0
LOOP
	READNEXT RecKey ELSE Done = 1
UNTIL Done 
	RecCnt += 1
	Send_Info(RecCnt)
	IF INDEX(RecKey,@SVM,1) OR INDEX(RecKey,@VM,1) OR INDEX(RecKey,@FM,1) THEN
		READ FungedRec FROM FileIn,RecKey THEN
			DEBUG
			*DELETE FileIn,RDSNo THEN
				Send_Dyn(RDSNo)
			*END
			
		END
	END
REPEAT

GOTO Bail

Skip:

CutOffDt = ICONV('2/28/2004','D')
Reactors = ''
Done = 0
RecCnt = 0
LOOP
	READNEXT RUKey ELSE Done = 1
UNTIL Done
	RecCnt += 1
	Send_Info(RecCnt)
	READ RURec FROM FileIn,RUKey THEN
		IF RURec<REACT_UTIL_END_DATE$> = '' THEN
			
			Reactor = RURec<REACT_UTIL_REACTOR$>
			IF Reactor = '' OR Reactor = 0 THEN
				debug
				*DELETE FileIn,RUKey ELSE Null
			END
			IF RURec<REACT_UTIL_START_DATE$> < CutOffDt THEN
				*DELETE FileIn,RUKey ELSE Null
			END
		END
	END
REPEAT


IF Get_Status(errCode) THEN DEBUG


* * * * * * *
Bail:
* * * * * * *


