COMPILE ROUTINE TEST_JCH(Dummy)
ROWDEF(CHARSTR)

COMMON /FILENAME/ Files_Array, Handles_Array

DECLARE SUBROUTINE obj_Schedule, RList,Send_Dyn, Print_Carton_Labels, Btree.Extract, msg, Set_List_Box_Data, Get_Status, Create_Table
DECLARE SUBROUTINE ErrMsg, Print_Small_Loc_Label, Print_Loc_Label, obj_RDS2, Set_Status, Send_Info, obj_Tables, obj_Location
DECLARE SUBROUTINE obj_WO_Log, obj_WM_In,obj_WM_Out, Make.List, ErrMsg, SetInitDirOptions, Msg, obj_Reprocess, obj_RDS
DECLARE SUBROUTINE obj_Export, Print_SAP_Cass_Ship_Label, obj_WO_MAT, obj_Notes, Send_Dyn, Send_Info, obj_WO_Wfr,Rename_Table

DECLARE FUNCTION Get_Status,Security_Check, Ping, FTPList, Utility, INet_OI_XML, obj_WM_Out,Get_Repos_Entities, obj_RDS, Printer_Select, obj_WO_MAT
DECLARE FUNCTION Repository, obj_Tables, Popup, obj_MUWafers, FTPList, FTPSend, Get_Property, List_User_Locks, Security_Check, Set_Printer, Get_Priner
DECLARE FUNCTION obj_LSL_Users, SRPSendMail, MemberOf, obj_Reactor, obj_Prod_Spec, obj_React_Run, Collect.IXVals


$INSERT WO_STEP_EQUATES
$INSERT WO_REACT_EQUATES
$INSERT WM_IN_EQUATES
$Insert COMPANY_EQUATES
$INSERT SURFACE_SCAN_EQUATES
$INSERT REACT_RUN_EQUATES
$INSERT CLEAN_INSP_EQUATES
$INSERT WM_OUT_EQUATES
$INSERT WO_MAT_EQUATES
$INSERT TOOL_EQUATES
$INSERT TOOL_CLASS_EQUATES
$INSERT WAREHOUSE_EQUATES
$INSERT SRPMail_Inserts


EQU PI$LEFT		TO	1
EQU PI$TOP		TO  2
EQU PI$RIGHT	TO	3
EQU PI$BOTTOM	TO	4
EQU PI$WIDTH	TO 	5
EQU PI$HEIGHT	TO	6
EQU PI$SIZE		TO	7


EQU CRLF$ TO \0D0A\
EQU TAB$ TO \09\

DEBUG


thisVal = ICONV('37','MD0')


GOTO Bail


WfrID = '162798*8*9'
ShipSlot = '162798*3*4'
RDSNo = 980616

CALL obj_React_Run('UnShipGANWfrs',RDSNo:@RM:ShipSlot:@RM:WfrID)



GOTO Bail

***  Parameter setup of SRPSendMail  ***

	ConfigFile = ''
	ConfigFile<1> = SendUsing_Port$
	ConfigFile<2> = ''
	ConfigFile<3> = 25                      	;// Server port
	*ConfigFile<4> = '10.36.10.51'				;// IFX Mail server
	ConfigFile<4>  = 'smtp.intra.infineon.com'	;// Infinfeon Mail Server
	ConfigFile<5> = 1                   		;// Authenticate
	
	ConfigFile<6> = 'oinotify@irf.com'			;// Username **************************** Suspected Problem *******************
	ConfigFile<7> = 'oinotify1'		        	;// Password **************************** Suspected Problem *******************
	
	ConfigFile<8> =	0						;// Use SSL
	
	SentFrom	= 'oinotify@irf.com'			;* Sent From eMail addr
	
	
	SendTo	 	= 'Francois.Rivard@infineon.com'					;* eMailAddr (comma separated)

	Message = ''
	Message<1> = 'eMail Test'						; // Subject
	Message<2> = SentFrom		           			; // From (email address)
	Message<3> = SendTo			            		; // Send to (email address)
	Message<5> = ''									; // Blind Carbon Copy (email address)
	*Message<6> = 'roderic.lathion@infineon.com'	; // Reply To (email address)
	Message<6> = ''									; // Reply To (email address)
	Message<7> = 'TEXT'								; // Content Type (TEXT or HTML)
	Message<8> = 'Test'								; // Content / Body
	Message<9> =''									; // Attachment(s) (path to file name(s))
	
	Def = ""
	Def<MTEXT$> = 'Sending eMail w/attachements ':ShipNo:'...'
	Def<MTYPE$> = "U"

	

	MsgSent = SRPSendMail(Message, ConfigFile)		;* T E M P O R A R Y *  until email is workding
	
	debug





GOTO Bail

OrgTable = '!PM_SCHED'
dbID = @DBID
NewTable = 'BAD_INDEX'
LockFlag = 0
Status = ''

DEBUG

CALL Rename_Table(OrgTable,dbID,NewTable,LockFlag,Status)

IF Get_Status(errCode) THEN
	ErrMsg(errCode)
END



GOTO Bail


OPEN 'WAREHOUSE' TO FileIn ELSE
	DEBUG
	GOTO Bail
END

DEBUG

LocKeys = XLATE('WAREHOUSE','1K',WAREHOUSE_LOC_KEY$,'X')

SortedKeys = ''

kCnt = COUNT(LocKeys,@VM) + (LocKeys NE '')

FOR I = 4 TO 99
	LocKey = LocKeys<1,I>
	IF LocKey NE '' THEN
		LOCATE LocKEy IN SortedKeys  BY 'AR' SETTING Pos ELSE	
			SortedKeys = INSERT(SortedKeys,1,Pos,0,LocKey)
		END
	END
	
NEXT I
/*
SortCnt = COUNT(SortedKeys,@VM) + (SortedKeys NE '')

FOR I = 1 TO SortCnt
	LocKey = SortedKeys<1,I>
	PRINT_SMALL_LOC_LABEL(LocKey

*/
GOTO Bail


DEBUG

SetInitDirOptions("D")
InitDir "R:\Ship_eMail\*.*"

SubDirList = ''

List = DirList()

LOOP
   	Line = List[1,@FM]
   	List[1,Col2()] = ""
UNTIL Line = ''
	IF Line NE '.' AND Line NE '..' THEN
		SubDirList<1,-1> = Line
	END
REPEAT




SetInitDirOptions("D")
InitDir 'R:\Ship_Data\*.*'

SubDirList = ''

List = DirList()

LOOP
   	Line = List[1,@FM]
   	List[1,Col2()] = ""
UNTIL Line = ''
	IF Line NE '.' AND Line NE '..' THEN
		SubDirList<1,-1> = Line
	END
REPEAT


GOTO Bail



WfrIDs  = '162798*6*12':@VM
WfrIDs := '162798*6*13':@VM
WfrIDs := '162798*6*14':@VM
WfrIDs := '162798*6*15'

CurrQueueID = 'GCH*Q_SP'
NextQueueID = 'GGR*Q_DISP'



CONVERT '.' TO '*' IN WfrIDs

EventBy		= 'BRYCE_BART'
EventDTM	=  OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS')


IF WfrIDs NE '' THEN

	Parms  = WfrIDs	:@RM			;* mv
	Parms := EventDtm:@RM
	Parms := EventBy:@RM
	Parms := 'SKIP':@RM				;* Event
	Parms := '':@RM					;* mv NewSlotIDs
	Parms := '':@RM					;* mv	RunLocs
	Parms := '':@RM					;* NCRNo		
	Parms := '':@RM					;*TWUse		
	Parms := '':@RM					;* mv	CurrSlotIDs
	Parms := '':@RM					;* NewToolID	
	Parms := '':@RM					;* CurrToolID
	Parms := NextQueueID:@RM		;* NewInvLoc	
	Parms := CurrQueueID:@RM		;* CurrInvLoc
	Parms := 'O':@RM				;* WfrSide	
	Parms := '':@RM					;* NewCarrLocs			;* mv
	Parms := '':@RM					;* CurrCarrLocs			;* mv
	Parms := ''						;* Scribes				;* mv

	*obj_WO_Wfr('TestAddEvent',Parms)

	IF Get_Status(errCode) THEN
		ErrMsg(ErrCode)
		RETURN
	END

END	;* End of check for wafers in the carrier


GOTO Bail
* * * * * * * * * * * * * *




@RECORD = XLATE('REACT_RUN',965970,'','X')


*QU REACT_RUN_IN_WFR_ID$ TO 81
*EQU REACT_RUN_CARR_WFR_ID$ TO 89
*EQU REACT_RUN_CARR_PREV_WFR_ID$ TO 90

EQU WO_WFR_SCRIBE$ TO 12

InWfrIDs            = @RECORD<REACT_RUN_IN_WFR_ID$>
CarrWfrIDs        = @RECORD<REACT_RUN_CARR_WFR_ID$>
PrevCarrWfrIDs = @RECORD<REACT_RUN_CARR_PREV_WFR_ID$>

lCnt = COUNT( InWfrIDs , @VM ) + ( InWfrIDs NE '' )
WfrIDs = ''

FOR I = 1 TO ICnt
    WfrID  = CarrWfrIDs<1,I>
    IF WfrID =  '' THEN
         WfrID = PrevCarrWfrIDs<1,I>
     END
     WfrIDs<1,I> = WfrID
NEXT I



@ANS = XLATE( 'WO_WFR' , WfrIDs , WO_WFR_SCRIBE$ , 'X')





GOTO Bail

EventBy		= 'BRYCE_BARB'
EventDTM	=  OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS')

WfrIDs 		= '162798*1*11':@VM:'162798*1*12':@VM:'162798*1*13':@VM:'162798*1*14':@VM:'162798*1*15'

Parms  = WfrIDs	:@RM			;* mv
Parms := EventDtm:@RM
Parms := EventBy:@RM
Parms := 'Skip':@RM				;* Event
Parms := '':@RM					;* mv NewSlotIDs
Parms := '':@RM					;* mv	RunLocs
Parms := '':@RM					;* NCRNo		
Parms := '':@RM					;*TWUse		
Parms := '':@RM					;* mv	CurrSlotIDs
Parms := '':@RM					;* NewToolID	
Parms := '':@RM					;* CurrToolID
Parms := 'GCH*WARP_Q':@RM		;* NewInvLoc	
Parms := 'GCH*UV_Q':@RM			;* CurrInvLoc
Parms := 'O':@RM				;* WfrSide	
Parms := '':@RM					;* NewCarrLocs			;* mv
Parms := '':@RM					;* CurrCarrLocs			;* mv
Parms := ''						;* Scribes				;* mv


obj_WO_Wfr('TestAddEvent',Parms)


DEBUG




/*
SortStageKeys = obj_Prod_Spec('GetStage','4645':@RM)

ToolClasses = XLATE('PRS_STAGE',SortStageKeys,'PROC_TOOL_CLASS','X')

QIns = XLATE('TOOL_CLASS',ToolClasses,'QIN_LOC_ID','X')
QOuts = XLATE('TOOL_CLASS',ToolClasses,'QOUT_LOC_ID','X')
*/



GOTO Bail

* * * * ************************************

WONo = '162710'

WOMatKeys = XLATE('WO_LOG',162710,31,'X')		;*WO_LOG_WO_MAT_KEY$

WfrsRxd			= 75								;* Total Wafers received
CassettesRxd 	= 3


CassShipQty = 8

IF CassShipQty <= 0 THEN CassShipQty = 25

WOMatReq 		= INT(WfrsRxd/CassShipQty)								;* Qty of WO_MAT records required


a = MOD(WfrsRxd,CassShipQty)

IF MOD(WfrsRxd,CassShipQty) THEN
	WOMatReq += 1														;* Add another WO_MAT for a short qty box at the end
END




LastInCassNo = ''
LastOutCassNo = ''

* * * *  Loop through existing WOMatKeys and set pointers for newly received information  * * * *

IF WOMatKeys NE '' THEN
	womCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '')
	FOR I = 1 TO womCnt
		WOMatKey	= WOMatKeys<1,I>
		RxDTM 		= XLATE('WO_MAT',WOMatKey,WO_MAT_RX_DTM$,'X')
		IF RxDTM NE '' THEN
			LastInCassNo = I		;* This assumes cassettes received are in numerical order and none have been deleted out of sequence
		END
		LastOutCassNo = I
	NEXT I
END



NextInCassNo = LastInCassNo + 1
NextOutCassNo = LastOutCassNo + 1

FOR I = 1 TO WOMatReq

	
		CassNo = NextInCassNo
		WOMatKey = WONo:'*':CassNo
		
		WOMatExists = ''
		
		LOCATE WOMatKey IN WOMatKeys BY 'AR' USING @VM SETTING NewPos ELSE
			WOMatKeys = INSERT(WOMatKeys,1,NewPos,0,WOMatKey)
		END
		
	
		otParms = 'WO_MAT':@RM:WOMatKey
	
		WOMatRec = obj_Tables('ReadRec',otParms)		;* WOMat record may be an outbound on
		
		IF Get_Status(errCode) THEN 
			DEBUG
		END
		
		IF WOMatRec NE '' THEN WOMatExists = 1
		
		IF WOMatExists THEN
			* Update the existing WO_MAT Record
		END ELSE
			* * Create new WO_MAT record with Receiving Data * *
			
			WOMatRec = ''	
			
		END 	;* End of check for existing WO_MAT record
		
		NextInCassNo += 1
		
		IF NextInCassNo >= NextOutCassNo THEN
			NextOutCassNo += 1
		END
NEXT I

GOTO Bail


*******************************************************************


WOWfrRec = XLATE('WO_WFR','162545*1*1','','X')

RPZs = WOWfrRec<5>
	
LOOP
	RPZ =  RPZs[-1,'B':@VM]
UNTIL RPZ NE '' OR RPZs = ''
	RPZs[COL1(),20] = ''
REPEAT
	
as = COL1()
af = COL2()

GOTO Bail





Select FileIn



Done = 0
RecCnt = 0
FixCnt = 0

DEBUG


LOOP
	READNEXT SSKey ELSE Done = 1
UNTIL Done 
	DELETE FileIn,SSKey THEN
		Send_Dyn(SSKey:' purged')
	END
REPEAT

GOTO Bail

Done = 0
RecCnt = 0
FixCnt = 0

DEBUG


LOOP
	READNEXT SSKey ELSE Done = 1
UNTIL Done 
	WONo 	= SSKey[1,'*']
	WOStep	= SSKey[COL2()+1,'*']
	CassNo	= SSKey[COL2()+1,'*']
	Stage	= SSKey[COL2()+1,'*']
	
	
	READ SurfRec FROM FileIn,SSKey THEN
		RecCnt += 1
		
		
		
		RDSNo = SurfRec<SURFACE_SCAN_RDS_NO$>
		
		IF RDSNo NE '' THEN
		
			RRunRec = XLATE('REACT_RUN',RDSNo,'','X')
			
			IF RRunRec NE '' THEN
			
				FixCnt += 1
				
				CINos 		= RRunRec<REACT_RUN_CI_NO$>
			 	CIStages	= RRunRec<REACT_RUN_CI_STAGE$>
				CIStage		= ''
				
			 	IF CINos = '' THEN
			 		DELETE FileIn,SSKey THEN
			 			Send_Info(RecCnt:' ':RDSNo:' -> ':SSKey:' Purged ')
			 		END
			 	END ELSE
			 	
			 		BEGIN CASE
			 		
			 			CASE Stage = 'PC'
			 				CIStage = 'POST'
			 				
			 			CASE Stage = 'PE'
			 				CIStage = 'PRE'
			 				
			 			CASE Stage = 'FW'
			 				
			 				IF INDEX(CIStages,'FWI',1) THEN CIStage = 'FWI'
			 				IF INDEX(CIStages,'LWI',1) THEN CIStage = 'LWI'
			 				
			 				IF CIStage = '' AND CIstages = 'PRE':@VM:@VM:'POST' THEN
			 					
			 					READ CIRec FROM CITable,CINos<1,2> THEN
			 						CIRec<CLEAN_INSP_STAGE$> = 'FWI'
			 						WRITE CIRec ON CITable,CINos<1,2> THEN
			 							CIStages<1,2> = 'FWI'
			 							CIStage = 'FWI'
			 						END
			 					END
			 				 
			 				  
			 				   
			 				END	;* End of missing Stage fixit
			 				
			 			CASE 1
			 				
			 				CIStage = ''
			 				
			 		END CASE
			 		
			 		IF CIStage NE '' THEN
			 		
		 				LOCATE CIStage IN CIStages USING @VM SETTING Pos THEN
		 					CINo = CINos<1,Pos>
		 				
		 				
		 					
		 					IF CINo NE '' THEN
		 							 						 					
			 					READ CIRec FROM CITable,CINo THEN
			 					
			 						ScanUser	= SurfRec<SURFACE_SCAN_SCAN_USER$>
			 						ScanDTM		= SurfRec<SURFACE_SCAN_SCAN_DTM$>
			 						
		 						
			 						LOCATE ScanDTM IN CIRec<CLEAN_INSP_SCAN_SIG_DTM$> USING @VM SETTING SPos THEN
			 							CIRec<CLEAN_INSP_SCAN_SIG$,SPos> = ScanUser
			 						
			 							WRITE CIRec ON CITable,CINo THEN
			 								DELETE FileIn,SSKey THEN
			 									Send_Dyn(RecCnt:' CI ':CINo:' Updated - Surfscan Rec ':SSKey: ' purged')
			 								END
			 							END		;* End of CIRec write
			 					 					
			 						END	ELSE
			 							ScanFlag = 0
			 							IF CIRec<CLEAN_INSP_SCAN_TOOL$> 			NE '' THEN ScanFlag = 1
			 							IF CIRec<CLEAN_INSP_SCAN_SUM_OF_DEF_MIN$>	NE '' THEN ScanFlag = 1
			 							IF CIRec<CLEAN_INSP_SCAN_SUM_OF_DEF_MAX$>	NE '' THEN ScanFlag = 1
			 							IF CIRec<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$>	NE '' THEN ScanFlag = 1
			 							IF CIRec<CLEAN_INSP_SCAN_HAZE_AVG_AVG$>		NE '' THEN ScanFlag = 1
			 							IF CIRec<CLEAN_INSP_SCAN_SIG$>				NE '' THEN ScanFlag = 1
			 							IF CIRec<CLEAN_INSP_INSP_SIG_DTM$>			NE '' THEN ScanFlag = 1
			 							
			 							IF NOT(ScanFlag) THEN
			 								CIRec<CLEAN_INSP_SCAN_TOOL$>			= SurfRec<SURFACE_SCAN_SCAN_TOOL$>
			 								CIRec<CLEAN_INSP_SCAN_SUM_OF_DEF_MIN$>	= SurfRec<SURFACE_SCAN_SUM_OF_DEF_MIN$>
			 								CIRec<CLEAN_INSP_SCAN_SUM_OF_DEF_MAX$>	= SurfRec<SURFACE_SCAN_SUM_OF_DEF_MAX$>
			 								CIRec<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$>	= SurfRec<SURFACE_SCAN_SUM_OF_DEF_AVG$>
			 								CIRec<CLEAN_INSP_SCAN_HAZE_AVG_AVG$>	= SurfRec<SURFACE_SCAN_HAZE_AVG_AVG$>
			 								CIRec<CLEAN_INSP_SCAN_SIG$>				= SurfRec<SURFACE_SCAN_SCAN_USER$>
			 								CIRec<CLEAN_INSP_INSP_SIG_DTM$>			= SurfRec<SURFACE_SCAN_SCAN_DTM$>
			 								
			 								WRITE CIRec ON CITable,CINo THEN
				 								DELETE FileIn,SSKey THEN
				 									Send_Dyn(RecCnt:' CI ':CINo:' Updated - Surfscan Rec ':SSKey: ' purged')
				 								END
				 							END		;* End of CIRec write
			 							END	ELSE
			 								DELETE FileIn,SSKey THEN
			 									Send_Dyn(RecCnt:' CI ':CINo:' Sig DTM mismatch ':SSKey: ' purged')
			 								END
			 							END;* End of check for ScanFlag	
			 						END;* End of Locate ScanDTM
			 					
			 					END ELSE
			 					
			 						DELETE FileIn,SSKey THEN
	 									Send_Dyn(RecCnt:' CI ':CINo:' NOT FOUND - Surfscan Rec ':SSKey: ' purged')
	 								END
			 						
			 					END	;* End of record read
			 					
			 				END ELSE
			 				
			 					DELETE FileIn,SSKey THEN
 									Send_Dyn(RecCnt:' Null CINo found with CIStage ':CIStage:' in REACT_RUN record')
 								END
 								
			 				END	;* End of check for null CINo in REACT_RUN
		 					
		 					
		 				END	ELSE
		 					DELETE FileIn,SSKey THEN
		 						Send_Dyn(RecCnt:' CIStage ':CISTage:' not found in REACT_RUN Records':SSKey: ' purged')
		 					END
		 				END ;* End OF Stage LOCATE
			 				
			 		END	ELSE
			 			Send_Dyn(RecCnt:'Null CIStage for Stage: ':Stage)
			 		END;* End of check for Null CIStage		
			 		
			 	END		;* End of check for CINos
			 	
			END	;* End of RRunRec read
			
		END ELSE
		
			NULL
			/*
			
				WMOKey = FIELD(SSKey,'*',1,3)
				
				CINo = XLATE('WM_OUT',WMOKey,WM_OUT_CI_NO$,'X')
				
				IF CINo NE '' THEN
				
					READ CIRec FROM CITable,CINo THEN
				
						ScanUser	= SurfRec<SURFACE_SCAN_SCAN_USER$>
					 	ScanDTM		= SurfRec<SURFACE_SCAN_SCAN_DTM$>
					
						LOCATE ScanDTM IN CIRec<CLEAN_INSP_SCAN_SIG_DTM$> USING @VM SETTING SPos THEN
							CIRec<CLEAN_INSP_SCAN_SIG$,SPos> = ScanUser
							
							
							WRITE CIRec ON CITable,CINo THEN
								DELETE FileIn,SSKey THEN
									Send_Info(RecCnt:' CI ':CINo:' Updated - Surfscan Rec ':SSKey: ' purged')
								END
							END		;* End of CIRec write
					 					
						END	;* End of Locatre ScanDTM
						
					END ELSE
					
						DELETE FileIn,SSKey THEN
							Send_Info(RecCnt:' CIRec ':CINo:' NOT FOUND - Surfscan Rec ':SSKey: ' purged')
						END
					END
				
				END ELSE
					DELETE FileIn,SSKey THEN
						Send_Info(RecCnt:' Null CINo ON WM_OUT RECORD - Surfscan Rec ':SSKey: ' purged')
					END
				
				END
			*/	
				
		END	;* End of check for Null RDS No
			
		Send_Info(RecCnt)
	
	END	;* End of Srface Rec Read

REPEAT





GOTO Bail


BatchID = 'M007673.2'

Open 'DICT.WO_MAT' To DictWOMat Then
		
	Search			= 'SAP_BATCH_NO':@VM:BatchID:@FM
	Flag			= ''
	ScanWOMatKey 	= ''
	
	Set_Status(0)
	Btree.Extract(Search,'WO_MAT',DictWOMat,ScanWOMatKey,'',Flag)
	If Get_Status(errCode) Then
		ErrMsg(errCode)
	End
	
	If ScanWOMatKey NE '' Then
		CassID = Xlate('WO_MAT',ScanWOMatKey,'CASS_ID_SAP','X')
		
		If CheckID Matches "0N'.'1N'.'0N" THEN
			WMOKey = Xlate('WO_MAT',ScanWOMatKey,WO_MAT_WMO_KEY$,'X')
			Convert '*' To '.' In WMOKey 
			CassID = WMOKey
		End
		
		*Set_Property(CtrlEntID,'INVALUE',CassID,PrevSelPos)
	End Else
		*Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
		*Set_Property(CtrlEntID,'INVALUE','',PrevSelPos)		;* No corresponding data record found for label scanned bad read or wrong thing scanned
		*Return 

	END
End		;* End of DictWOMat open

Goto Bail


Result = obj_Prod_Spec('GetQAMet',4521:@RM:@RM)


DEBUG


GOTO Bail




Set_Status(1,'STPROC','Missing Reactor No. on RDS':@SVM:'Reactor No. is required prior to recording test results.')

ErrMsg('STPROC':@VM:'Missing Reactor No. on RDS':@SVM:'Reactor No. is required prior to recording test results.')



DEBUG


GOTO Bail

/*

WOReactKey = '159608*1*61'
WOReactRec = XLATE('WO_REACT',WOReactKey,'','X')

RDSNos		= WOReactRec<WO_REACT_RDS_NO$>

WONo	= FIELD(WOReactKey,'*',1)
StepNo	= FIELD(WOReactKey,'*',2)



* * * * * * Prototype for obj_WO_React('RemRdsNo'  routine

PSNos = XLATE('WO_LOG',WoNo,'PROD_VER_STEP_PSN','X')
PSNo = PSNos<1,StepNo>

QAMetData = obj_Prod_Spec('GetQAMet',PSNo:@RM:@RM:1)	;* Get Reactor Scheduled QA Metrology 

Start		= QAMetData<COL$QA_MET_SLOT>
Interval	= QAMetData<COL$QA_MET_INTERVAL>

AllTestPos = ''

*RemRDSNo = 871366
RemRDSNo = 870613

* Build list of all RDS sequence positions on this WO-REACT that require the test

RDSCnt = COUNT(RDSNos,@VM) + (RDSNos NE '')
SeqCnt = 0
FOR TestSeq = 1 TO RDSCnt
	IF REM((TestSeq - Start),Interval) = 0 THEN
		AllTestPos<1,-1> = TestSeq
		SeqCnt += 1
	END
	Send_Dyn(AllTestPos)
NEXT TestSeq

* Find where the the RDS being removed is in the list.

DEBUG

LOCATE RemRDSNo IN WOReactRec<WO_REACT_RDS_NO$> USING @VM SETTING RemPos THEN

	LOCATE RemPos IN AllTestPos BY 'AR' USING @VM SETTING TrimPos ELSE Null
	
	UnschedPosList = FIELD(AllTestPos,@VM,TrimPos,SeqCnt)

	upCnt = COUNT(UnschedPosList,@VM) + (UnschedPosList NE '')
	
	FOR I = 1 TO upCnt
		CassNo = 
	
	NEXT I
	
	

END ELSE
	* Houston we have a problem
	DEBUG
	GOTO Bail
END



GOTO Bail
*/
**********************************************************************


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

END

