COMPILE ROUTINE LOAD_WO_REACT(WONo)
ROWDEF(CHARSTR)

DECLARE SUBROUTINE obj_WO_React,RList, Send_Info
DECLARE FUNCTION Msg, Get_Status

$INSERT WO_LOG_EQUATES
$INSERT WO_STEP_EQUATES
$INSERT WO_MAT_EQUATES
$INSERT REACTOR_EQUATES
$INSERT RDS_EQUATES
$INSERT RLIST_EQUATES

debug

OPEN 'WO_LOG' TO WOLogFile ELSE
	DEBUG
	GOTO Bail
END

RList('SELECT WO_LOG WITH WO GE 159000 ',TARGET_ACTIVELIST$, "", "", "")

IF Get_Status(errCode) THEN DEBUG

DEBUG

Done = 0
RecCnt = 0
LOOP
	READNEXT WONo ELSE Done = 1
UNTIL DONE

	READ WOLogRec FROM WOLogFile,WONo THEN
		RecCnt += 1

		WOSteps		= WOLogRec<WO_LOG_WO_STEP_KEY$>

		stepCnt = COUNT(WOSteps,@VM) + (WOSteps NE '')

		FOR Step = 1 TO stepCnt

			WOStepKey	= WOSteps<1,Step>
			StepNo 		= FIELD(WOStepKey,'*',2)
			
			
			RDSNos = XLATE('WO_STEP',WOStepKey,WO_STEP_RDS_KEY$,'X')
				
			runCnt = COUNT(RDSNos,@VM) + (RDSNos NE '')
			
			FOR R = 1 TO RunCnt
				RDSNo = RDSNos<1,R>
				ReactNo = XLATE('RDS',RDSNo,RDS_REACTOR$,'X')
				
				obj_WO_React('AddRdsNo',WONo:@RM:StepNo:@RM:ReactNo:@RM:RDSNo)
			
				Send_Info(RecCnt:' ':WONo:' ':StepNo:' ':RDSNo)
			NEXT R
				
				
		NEXT Step
	END	;* End of WOLogRec READ
REPEAT


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

END
