COMPILE ROUTINE TEST_obj_Clean_Insp(RDSNo)
ROWDEF(CHARSTR)

DECLARE SUBROUTINE RList, Set_Status, obj_Clean_Insp
DECLARE FUNCTION Get_Status, obj_Clean_Insp, Get_Status

$INSERT RDS_EQU
$INSERT REACT_RUN_EQUATES
$INSERT WO_MAT_EQUATES


WONo	= 157836
WOStep	= 1
CassNo	= 1
Stages	= 'LWI'
RDSNo	= 826948
PSNo	= 4183

ociParms  = WONo:@RM
ociParms := WOStep:@RM
ociParms := CassNo:@RM
ociParms := Stages:@RM
ociParms := RDSNo:@RM
ociParms := PSNo


DEBUG

CINo = obj_Clean_Insp('Create',ociParms)

DEBUG


GOTO Bail

CINo = '1586169'
PsStageKey = '4334*POST'

obj_Clean_Insp('SpecDelta',CINo:@RM:PsStageKey)

IF Get_Status(errCode) THEN
	DEBUG
END

GOTO Bail



EQU TARGET_ACTIVELIST$ to 5
SelectSent = 'SELECT 10 RDS  WITH PRE_CODE NE "" AND WITH SEQ > 500000 '

RList(SelectSent,TARGET_ACTIVELIST$, "", "", "")

IF Get_Status(errCode) THEN
	DEBUG
END


DEBUG

RDSNo = 726925


OPEN 'DICT.RDS' TO @DICT ELSE NULL


@RECORD = XLATE('RDS',726925,'','X')

POST_CI_ACTION	= {POST_CI_ACTION}
POST_CI_SIG		= {POST_CI_SIG}
POST_CI_SIG_DTM = {POST_CI_SIG_DTM}
POST_CI_TOOL	= {POST_CI_TOOL}





PreCINo		= XLATE('RDS',RDSNo,'PRE_CI_NO','X')
WfrCINo		= XLATE('RDS',RDSNo,'WFR_CI_NO','X')
PostCINo	= XLATE('RDS',RDSNo,'POST_CI_NO','X')

PreData = obj_Clean_Insp('GetActions',PreCINo)

WfrData = obj_Clean_Insp('GetActions',WfrCINo)

PostData = obj_Clean_Insp('GetActions',PostCINo)


DEBUG


GOTO Bail

DEBUG

Done = 0

LOOP
	READNEXT RDSNo ELSE Done = 1
UNTIL Done
	RRRec = XLATE('REACT_RUN',RDSNo,'','X')
	
	WONo	= RRRec<REACT_RUN_WO_NO$>
	WOStep	= RRRec<REACT_RUN_WO_STEP$>
	CassNo	= RRRec<REACT_RUN_CASS_NO$>
	
	
	PreCINo	= RRRec<REACT_RUN_PRE_CI_NO$>
	WfrCINo	= RRRec<REACT_RUN_WFR_CI_NO$>
	PosCINo	= RRRec<REACT_RUN_POST_CI_NO$>
	
	PSNo = XLATE('WO_STEP',WONo:'*':WOStep,1,'X')
	PSRec = XLATE('PROD_SPEC',PSNo,'','X')
	
	IF PreCINo NE '' THEN
		CINo = obj_Clean_Insp('Create',WONo:@RM:WOStep:@RM:CassNo:@RM:'POST':@RM:RDSNo:@RM:PSNo:@RM:PSRec)
	END






REPEAT

GOTO Bail


DEBUG

RDSNo = 206956

	RDSRec = XLATE('RDS',RDSNo,'','X')
	PreCodes = RDSRec<RDS_PRE_CODE$>
	
	PCCnt = COUNT(PreCodes,@VM) + (PreCodes NE '')
	
	FOR I = 1 TO PCCnt
		CleanTool = PreCodes<1,I>
		IF CleanTool NE '' THEN
			PreCINo = XLATE('REACT_RUN',RDSNo,REACT_RUN_PRE_CI_NO$,'X')
			
			
			
			Parms  = PreCINo
			Parms := @RM:CleanTool
			Parms := @RM:RDSRec<RDS_PRE_BOAT_ID$,I>
			Parms := @RM:RDSRec<RDS_PRE_SRD_NUM$,I>
			Parms := @RM:RDSRec<RDS_PRE_EPI_SIG$,I>
			Parms := @RM:OCONV(RDSRec<RDS_PRE_EPI_SIG_DATE$,I>,'D4')
			Parms := @RM:OCONV(RDSRec<RDS_PRE_EPI_SIG_TIME$,I>,'MTS')
			
			obj_Clean_Insp('SetClean',Parms)
			
		END	;* End of check for Clean Tool
	NEXT I
/*	
REPEAT
*/

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

RETURN
